forked from mirror/pixelfed
Update StatusController
This commit is contained in:
parent
7d7a64382b
commit
6095f4c9c7
1 changed files with 4 additions and 1 deletions
|
@ -234,7 +234,8 @@ class StatusController extends Controller
|
|||
'item' => 'required|integer|min:1',
|
||||
]);
|
||||
|
||||
$profile = Auth::user()->profile;
|
||||
$user = Auth::user();
|
||||
$profile = $user->profile;
|
||||
$status = Status::withCount('shares')->findOrFail($request->input('item'));
|
||||
|
||||
$count = $status->shares_count;
|
||||
|
@ -265,6 +266,8 @@ class StatusController extends Controller
|
|||
$status->save();
|
||||
}
|
||||
|
||||
Cache::forget('status:'.$status->id.':sharedby:userid:'.$user->id);
|
||||
|
||||
if ($request->ajax()) {
|
||||
$response = ['code' => 200, 'msg' => 'Share saved', 'count' => $count];
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue