Skip to content

Commit

Permalink
[Update] Feed Pinning
Browse files Browse the repository at this point in the history
- Added `is_pinned` column to feed messages schema
- Updated FeedMessageResourceBasic to include `isPinned` attribute
  • Loading branch information
kiritokatklian committed Oct 22, 2024
1 parent 9a9f04f commit 4d4b3f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Http/Resources/FeedMessageResourceBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ public function toArray(Request $request): array
'replyCount' => (int) $this->resource->replies_count,
'reShareCount' => (int) $this->resource->re_shares_count
],
'isNSFW' => $this->resource->is_nsfw,
'isPinned' => $this->resource->is_pinned,
'isReply' => $this->resource->is_reply,
'isReShare' => $this->resource->is_reshare,
'isReShared' => (bool) $this->resource->isReShared,
'isNSFW' => $this->resource->is_nsfw,
'isSpoiler' => $this->resource->is_spoiler,
'createdAt' => $this->resource->created_at->timestamp,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public function up(): void
$table->text('content');
$table->text('content_html');
$table->text('content_markdown');
$table->boolean('is_nsfw')->default(false);
$table->boolean('is_pinned')->default(false);
$table->boolean('is_reply')->default(false);
$table->boolean('is_reshare')->default(false);
$table->boolean('is_nsfw')->default(false);
$table->boolean('is_spoiler')->default(false);
$table->timestamps();
});
Expand Down

0 comments on commit 4d4b3f1

Please sign in to comment.