Update InternalApiController, fixes #1901

This commit is contained in:
Daniel Supernault 2019-12-31 16:26:53 -07:00
parent 2189dfb5f6
commit 758e633c2c
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -244,7 +244,7 @@ class InternalApiController extends Controller
'cw' => 'nullable|boolean', 'cw' => 'nullable|boolean',
'visibility' => 'required|string|in:public,private,unlisted|min:2|max:10', 'visibility' => 'required|string|in:public,private,unlisted|min:2|max:10',
'place' => 'nullable', 'place' => 'nullable',
'comments_disabled' => 'nullable|boolean' 'comments_disabled' => 'nullable'
]); ]);
if(config('costar.enabled') == true) { if(config('costar.enabled') == true) {
@ -301,7 +301,7 @@ class InternalApiController extends Controller
} }
if($request->filled('comments_disabled')) { if($request->filled('comments_disabled')) {
$status->comments_disabled = $request->input('comments_disabled'); $status->comments_disabled = (bool) $request->input('comments_disabled');
} }
$status->caption = strip_tags($request->caption); $status->caption = strip_tags($request->caption);
@ -314,10 +314,6 @@ class InternalApiController extends Controller
$media->save(); $media->save();
} }
// $resource = new Fractal\Resource\Collection($status->media()->orderBy('order')->get(), new StatusMediaContainerTransformer());
// $mediaContainer = $this->fractal->createData($resource)->toArray();
// $status->media_container = json_encode($mediaContainer);
$visibility = $profile->unlisted == true && $visibility == 'public' ? 'unlisted' : $visibility; $visibility = $profile->unlisted == true && $visibility == 'public' ? 'unlisted' : $visibility;
$cw = $profile->cw == true ? true : $cw; $cw = $profile->cw == true ? true : $cw;
$status->is_nsfw = $cw; $status->is_nsfw = $cw;