Update CommentPipeline, move reply_count calculation to comment pipeline job and improve count calculation
This commit is contained in:
parent
945a7e49f5
commit
b6b0837f49
2 changed files with 13 additions and 9 deletions
|
@ -73,14 +73,11 @@ class CommentController extends Controller
|
|||
$reply->visibility = $scope;
|
||||
$reply->save();
|
||||
|
||||
$status->reply_count++;
|
||||
$status->save();
|
||||
|
||||
return $reply;
|
||||
});
|
||||
|
||||
StatusService::del($status->id);
|
||||
NewStatusPipeline::dispatch($reply, false);
|
||||
NewStatusPipeline::dispatch($reply);
|
||||
CommentPipeline::dispatch($status, $reply);
|
||||
|
||||
if ($request->ajax()) {
|
||||
|
@ -89,11 +86,11 @@ class CommentController extends Controller
|
|||
$entity = new Fractal\Resource\Item($reply, new StatusTransformer());
|
||||
$entity = $fractal->createData($entity)->toArray();
|
||||
$response = [
|
||||
'code' => 200,
|
||||
'msg' => 'Comment saved',
|
||||
'username' => $profile->username,
|
||||
'url' => $reply->url(),
|
||||
'profile' => $profile->url(),
|
||||
'code' => 200,
|
||||
'msg' => 'Comment saved',
|
||||
'username' => $profile->username,
|
||||
'url' => $reply->url(),
|
||||
'profile' => $profile->url(),
|
||||
'comment' => $reply->caption,
|
||||
'entity' => $entity,
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue