From bf17e2471bb251c739e3da9581ec060443c4347e Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Fri, 27 Nov 2026 19:40:21 +1100 Subject: [PATCH] fix(ui): stop offering an organisation the binary cannot create (#2150) The organisations page could create one, and POST /api/orgs is not served: the binary resolves a single organisation from the credential. The dialog and the client method go, and the page lists what exists. The gateway test missed it because it compared paths, not methods. It now reads each request the client makes with the method it asks for, so a call to a path the binary serves for another verb fails the gate. --- ui/src/lib/api.ts | 6 +- ui/src/org/NewOrgDialog.vue | 105 ------------------------ ui/src/pages/settings/organisations.vue | 3 +- ui/test/api-paths.test.ts | 102 +++++++++++++++++++---- 4 files changed, 86 insertions(+), 130 deletions(-) delete mode 100644 ui/src/org/NewOrgDialog.vue diff --git a/ui/src/lib/api.ts b/ui/src/lib/api.ts index 46f3c219e..99c35f7db 100644 --- a/ui/src/lib/api.ts +++ b/ui/src/lib/api.ts @@ -185,7 +185,7 @@ async function request( export const api = { // The archie binary's module API; the wire types are below the object. - runs: (limit = 200, workflowId?: string, sysQuery?: string) => + runs: (limit = 50, workflowId?: string, sysQuery?: string) => request("/api/runs" + qs({ limit, workflow_id: workflowId, sys_query: sysQuery })), run: (id: string) => request(`/api/runs/${encodeURIComponent(id)}`), /** Queues a parked run again from the step that parked it, or from `from`. */ @@ -401,10 +401,6 @@ export const api = { deletePolicy: (policy: unknown) => request("/api/access/policies", { method: "DELETE", body: policy, parse: false }), orgs: () => request("/api/orgs"), - // orgCreate makes an org with its default workspace and first owner; only - // an instance admin may. - orgCreate: (org: { id: string; name: string; owner_identity: string }) => - request("/api/orgs", { method: "POST", body: org }), org: (id: string) => request(`/api/orgs/${encodeURIComponent(id)}`), // renameOrg changes the org's display name; expected_version refuses a save // made from a name someone else has since changed. diff --git a/ui/src/org/NewOrgDialog.vue b/ui/src/org/NewOrgDialog.vue deleted file mode 100644 index f2d16a1c9..000000000 --- a/ui/src/org/NewOrgDialog.vue +++ /dev/null @@ -1,105 +0,0 @@ - - - diff --git a/ui/src/pages/settings/organisations.vue b/ui/src/pages/settings/organisations.vue index e3c7a747f..6f29f6763 100644 --- a/ui/src/pages/settings/organisations.vue +++ b/ui/src/pages/settings/organisations.vue @@ -20,7 +20,6 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty"; import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemTitle } from "@/components/ui/item"; -import NewOrgDialog from "@/org/NewOrgDialog.vue"; import { useOrgStore } from "@/stores/org"; import { errors } from "@/copy/errors"; import { describeError } from "@/lib/api"; @@ -51,7 +50,7 @@ function open(id: string): void {