mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update ApiV1Controller, improve statusesById perf and dispatch CommentPipeline job when applicable
This commit is contained in:
parent
b6b0837f49
commit
466286af92
1 changed files with 7 additions and 3 deletions
|
@ -42,6 +42,7 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||||
use App\Http\Controllers\StatusController;
|
use App\Http\Controllers\StatusController;
|
||||||
|
|
||||||
use App\Jobs\AvatarPipeline\AvatarOptimize;
|
use App\Jobs\AvatarPipeline\AvatarOptimize;
|
||||||
|
use App\Jobs\CommentPipeline\CommentPipeline;
|
||||||
use App\Jobs\LikePipeline\LikePipeline;
|
use App\Jobs\LikePipeline\LikePipeline;
|
||||||
use App\Jobs\SharePipeline\SharePipeline;
|
use App\Jobs\SharePipeline\SharePipeline;
|
||||||
use App\Jobs\StatusPipeline\NewStatusPipeline;
|
use App\Jobs\StatusPipeline\NewStatusPipeline;
|
||||||
|
@ -1799,9 +1800,9 @@ class ApiV1Controller extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$resource = new Fractal\Resource\Item($status, new StatusTransformer());
|
$res = StatusService::get($status->id);
|
||||||
$res = $this->fractal->createData($resource)->toArray();
|
$res['favourited'] = LikeService::liked($user->profile_id, $status->id);
|
||||||
|
$res['reblogged'] = false;
|
||||||
return response()->json($res);
|
return response()->json($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2114,6 +2115,9 @@ class ApiV1Controller extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
NewStatusPipeline::dispatch($status);
|
NewStatusPipeline::dispatch($status);
|
||||||
|
if($status->in_reply_to_id) {
|
||||||
|
CommentPipeline::dispatch($parent, $status);
|
||||||
|
}
|
||||||
Cache::forget('user:account:id:'.$user->id);
|
Cache::forget('user:account:id:'.$user->id);
|
||||||
Cache::forget('_api:statuses:recent_9:'.$user->profile_id);
|
Cache::forget('_api:statuses:recent_9:'.$user->profile_id);
|
||||||
Cache::forget('profile:status_count:'.$user->profile_id);
|
Cache::forget('profile:status_count:'.$user->profile_id);
|
||||||
|
|
Loading…
Reference in a new issue