Browse Source

项目需求校验团队用户调整

kely 8 tháng trước cách đây
mục cha
commit
dba65cd07a
1 tập tin đã thay đổi với 1 bổ sung5 xóa
  1. 1 5
      app/Http/Controllers/API/ProjectController.php

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

@@ -451,11 +451,7 @@ class ProjectController extends Controller
 
     public function notLinkAssetRequirement(string $id)
     {
-        $isAction=true;
-        $project = Project::allowed($id,$isAction)->find($id);
-        if($project==null){
-            return $this->badRequest('Permission denied or project not found. Please contact the administrator.');
-        };
+        $project = Project::allowed($id)->findOrFail($id);;
 
         $requirements = $project->assets
             ? Requirement::query()->whereIn('asset_id', $project->assets?->pluck('id')->toArray())->whereNotIn('id', $project->requirements?->pluck('id')->toArray())->simplePaginate()