Browse Source

container linkage

moell 10 months ago
parent
commit
931d15cdd5
2 changed files with 11 additions and 2 deletions
  1. 9 0
      app/Http/Controllers/API/ContainerController.php
  2. 2 2
      routes/api.php

+ 9 - 0
app/Http/Controllers/API/ContainerController.php

@@ -169,4 +169,13 @@ class ContainerController extends Controller
 
         return $this->noContent();
     }
+
+    public function linkage(string $libraryId)
+    {
+        $items = Container::query()->allowed()->where("library_id", $libraryId)->get(['id', 'name']);
+
+        return $this->success([
+            'data' => $items
+        ]);
+    }
 }

+ 2 - 2
routes/api.php

@@ -143,8 +143,6 @@ Route::middleware(['auth:sanctum'])->group(function () {
         Route::get("plan-by-assets", [API\PlanController::class, "byAssets"])->name("plan.by-assets");
         Route::get("requirement-by-assets", [API\RequirementController::class, "byAssets"])->name("requirement.by-assets");
 
-
-
         Route::get("project-tree/{project_id}", [API\ProjectController::class, "treeIndex"])->name("project.project-tree");
 
         Route::get("project-link-requirements-group/{project_id}",[API\ProjectController::class, "requirementsLinkGroup"])->name("project.link-requirements-group");
@@ -163,5 +161,7 @@ Route::middleware(['auth:sanctum'])->group(function () {
         Route::get("notification", [API\NotificationController::class, "index"])->name("notification.index");
         Route::get("notification/unread", [API\NotificationController::class, "unread"])->name("notification.unread");
         Route::post("notification/mark-as-read", [API\NotificationController::class, "markAsRead"])->name("notification.mark-as-read");
+
+        Route::get("container-linkage/{library_id}", [API\ContainerController::class, "linkage"])->name("container.linkage");
     });
 });