Skip to content

Commit

Permalink
Update Api Controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Jun 19, 2019
1 parent 0b3c302 commit 1cff278
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/InternalApiController.php
Expand Up @@ -277,7 +277,7 @@ public function modAction(Request $request)
public function composePost(Request $request)
{
$this->validate($request, [
'caption' => 'nullable|string',
'caption' => 'nullable|string|max:'.config('pixelfed.max_caption_length', 500),
'media.*' => 'required',
'media.*.id' => 'required|integer|min:1',
'media.*.filter_class' => 'nullable|alpha_dash|max:30',
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/PublicApiController.php
Expand Up @@ -117,23 +117,23 @@ public function statusComments(Request $request, $username, int $postId)
if($request->filled('min_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->select('id', 'caption', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '>=', $request->min_id)
->orderBy('id', 'desc')
->paginate($limit);
}
if($request->filled('max_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->select('id', 'caption', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '<=', $request->max_id)
->orderBy('id', 'desc')
->paginate($limit);
}
} else {
$replies = $status->comments()
->whereNull('reblog_of_id')
->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->select('id', 'caption', 'is_nsfw', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->orderBy('id', 'desc')
->paginate($limit);
}
Expand Down

0 comments on commit 1cff278

Please sign in to comment.