mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update Like, Status and Comment controllers to add StatusService del() method to update counts
This commit is contained in:
parent
05b9445c8f
commit
eab4370c84
3 changed files with 8 additions and 1 deletions
|
@ -18,6 +18,7 @@ use League\Fractal;
|
|||
use App\Transformer\Api\StatusTransformer;
|
||||
use League\Fractal\Serializer\ArraySerializer;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use App\Services\StatusService;
|
||||
|
||||
class CommentController extends Controller
|
||||
{
|
||||
|
@ -78,6 +79,7 @@ class CommentController extends Controller
|
|||
return $reply;
|
||||
});
|
||||
|
||||
StatusService::del($status->id);
|
||||
NewStatusPipeline::dispatch($reply, false);
|
||||
CommentPipeline::dispatch($status, $reply);
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use App\User;
|
|||
use Auth;
|
||||
use Cache;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Services\StatusService;
|
||||
|
||||
class LikeController extends Controller
|
||||
{
|
||||
|
@ -58,6 +59,7 @@ class LikeController extends Controller
|
|||
}
|
||||
|
||||
Cache::forget('status:'.$status->id.':likedby:userid:'.$user->id);
|
||||
StatusService::del($status->id);
|
||||
|
||||
if ($request->ajax()) {
|
||||
$response = ['code' => 200, 'msg' => 'Like saved', 'count' => $count];
|
||||
|
|
|
@ -20,6 +20,7 @@ use League\Fractal;
|
|||
use App\Util\Media\Filter;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Services\HashidService;
|
||||
use App\Services\StatusService;
|
||||
|
||||
class StatusController extends Controller
|
||||
{
|
||||
|
@ -211,6 +212,7 @@ class StatusController extends Controller
|
|||
|
||||
Cache::forget('_api:statuses:recent_9:' . $status->profile_id);
|
||||
Cache::forget('profile:status_count:' . $status->profile_id);
|
||||
StatusService::del($status->id);
|
||||
if ($status->profile_id == $user->profile->id || $user->is_admin == true) {
|
||||
Cache::forget('profile:status_count:'.$status->profile_id);
|
||||
StatusDelete::dispatch($status);
|
||||
|
@ -266,7 +268,8 @@ class StatusController extends Controller
|
|||
}
|
||||
|
||||
Cache::forget('status:'.$status->id.':sharedby:userid:'.$user->id);
|
||||
|
||||
StatusService::del($status->id);
|
||||
|
||||
if ($request->ajax()) {
|
||||
$response = ['code' => 200, 'msg' => 'Share saved', 'count' => $count];
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue