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