peterguo 1 month ago
parent
commit
f46e2e9971
1 changed files with 2 additions and 3 deletions
  1. 2 3
      app/Http/Controllers/API/FileController.php

+ 2 - 3
app/Http/Controllers/API/FileController.php

@@ -67,8 +67,7 @@ class FileController extends Controller
             ->where("object_id", $file->object_id)
             ->update(['title' => $request->get('title')]);
 
-        ActionRepository::createByFile($file->object_id, $file->object_type, ObjectAction::EDITED_FILE);
-
+        ActionRepository::create($id, ActionObjectType::CONTAINER_FILE, ObjectAction::EDITED_FILE);
         return $this->noContent();
     }
 
@@ -94,7 +93,7 @@ class FileController extends Controller
 
         File::query()->whereIn("id", $files->pluck("id")->toArray())->delete();
 
-        ActionRepository::createByFile($file->object_id, $file->object_type, ObjectAction::DELETED_FILE);
+        ActionRepository::create($id, ActionObjectType::CONTAINER_FILE, ObjectAction::DELETED_FILE);
 
         Storage::delete($files->pluck("pathname")->toArray());