Преглед на файлове

Update InternalApiController for ComposeUI v4

Daniel Supernault преди 5 години
родител
ревизия
a3ae352fd2
променени са 1 файла, в които са добавени 8 реда и са изтрити 1 реда
  1. 8 1
      app/Http/Controllers/InternalApiController.php

+ 8 - 1
app/Http/Controllers/InternalApiController.php

@@ -240,7 +240,8 @@ class InternalApiController extends Controller
             'media.*.license' => 'nullable|string|max:80',
             'cw' => 'nullable|boolean',
             'visibility' => 'required|string|in:public,private,unlisted|min:2|max:10',
-            'place' => 'nullable'
+            'place' => 'nullable',
+            'comments_disabled' => 'nullable|boolean'
         ]);
 
         if(config('costar.enabled') == true) {
@@ -287,9 +288,15 @@ class InternalApiController extends Controller
         if($request->filled('place')) {
             $status->place_id = $request->input('place')['id'];
         }
+        
+        if($request->filled('comments_disabled')) {
+            $status->comments_disabled = $request->input('comments_disabled');
+        }
+
         $status->caption = strip_tags($request->caption);
         $status->scope = 'draft';
         $status->profile_id = $profile->id;
+
         $status->save();
 
         foreach($attachments as $media) {