Update StatusController

This commit is contained in:
Daniel Supernault 2019-06-18 01:16:10 -06:00
parent 7d7a64382b
commit 6095f4c9c7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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 {