Update ApiV1Controller, add optional place_id parameter to POST /api/v1/statuses endpoint

This commit is contained in:
Daniel Supernault 2022-09-19 00:48:08 -06:00
parent 79976a3f81
commit ef0d1f84ae
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -2477,6 +2477,7 @@ class ApiV1Controller extends Controller
'sensitive' => 'nullable',
'visibility' => 'string|in:private,unlisted,public',
'spoiler_text' => 'sometimes|max:140',
'place_id' => 'sometimes|integer|min:1|max:128769'
]);
if(config('costar.enabled') == true) {
@ -2566,6 +2567,9 @@ class ApiV1Controller extends Controller
$status->scope = 'draft';
$status->is_nsfw = $cw;
$status->cw_summary = $spoilerText;
if($request->has('place_id')) {
$status->place_id = $request->input('place_id');
}
$status->save();
}