Browse Source

Merge pull request #1518 from pixelfed/frontend-ui-refactor

Update CollectionController
daniel 6 năm trước cách đây
mục cha
commit
4230a5a6d1
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      app/Http/Controllers/CollectionController.php

+ 3 - 0
app/Http/Controllers/CollectionController.php

@@ -79,6 +79,9 @@ class CollectionController extends Controller
         ]);
         $profile = Auth::user()->profile;   
         $collection = Collection::whereProfileId($profile->id)->findOrFail($id);
+        if($collection->items()->count() == 0) {
+            abort(404);
+        }
         $collection->title = e($request->input('title'));
         $collection->description = e($request->input('description'));
         $collection->visibility = e($request->input('visibility'));