mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 00:35:59 +00:00
Update StatusController, add view method
This commit is contained in:
parent
5e13643246
commit
0cfc12c5dd
1 changed files with 21 additions and 0 deletions
|
@ -408,4 +408,25 @@ class StatusController extends Controller
|
||||||
|
|
||||||
return response()->json([200]);
|
return response()->json([200]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function storeView(Request $request)
|
||||||
|
{
|
||||||
|
abort_if(!$request->user(), 403);
|
||||||
|
|
||||||
|
$this->validate($request, [
|
||||||
|
'status_id' => 'required|integer|exists:statuses,id',
|
||||||
|
'profile_id' => 'required|integer|exists:profiles,id'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$sid = (int) $request->input('status_id');
|
||||||
|
$pid = (int) $request->input('profile_id');
|
||||||
|
|
||||||
|
StatusView::firstOrCreate([
|
||||||
|
'status_id' => $sid,
|
||||||
|
'status_profile_id' => $pid,
|
||||||
|
'profile_id' => $request->user()->profile_id
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue