Skip to content

Commit cd8330c

Browse files
committed
Update ApiController.php
1 parent 3bcb24a commit cd8330c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Http/Controllers/ApiController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ protected function move($ids, Request $request): JsonResponse
4343

4444
public function destroy(File $file)
4545
{
46+
if ($file->children->count() > 0) {
47+
return response()->json(['message' => __('A non-empty folder cannot be deleted.')], 403);
48+
}
4649
$file->delete();
4750
}
4851

0 commit comments

Comments
 (0)