|
@@ -67,7 +67,15 @@ class LibraryController extends Controller
|
|
|
*/
|
|
|
public function destroy(string $id)
|
|
|
{
|
|
|
- //
|
|
|
+ $library = Library::query()->allowed()->findOrFail($id);
|
|
|
+
|
|
|
+ if ($library->container()->count() > 0) {
|
|
|
+ return $this->badRequest("The container has been associated and is not allowed to be deleted");
|
|
|
+ }
|
|
|
+
|
|
|
+ $library->delete();
|
|
|
+
|
|
|
+ return $this->noContent();
|
|
|
}
|
|
|
|
|
|
public function linkage(Request $request, string $type)
|