Browse Source

项目编辑校验团队用户是否被限制

kely 8 months ago
parent
commit
6b6d2fdaca
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/Http/Controllers/API/ProjectController.php

+ 4 - 1
app/Http/Controllers/API/ProjectController.php

@@ -170,7 +170,10 @@ class ProjectController extends Controller
     public function update(CreateOrUpdateRequest $request, string $id)
     {
         $isAction=true;
-        $project = Project::allowed($id,$isAction)->findOrFail($id);
+        $project = Project::allowed($id,$isAction)->find($id);
+        if($project==null){
+            return $this->badRequest('Permission denied or project not found. Please contact the administrator.');
+        };
 
         $project->fill([
             ...$request->all(),