diff options
Diffstat (limited to 'makima/frontend/src/lib')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index a496412..17bc20f 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3295,7 +3295,7 @@ export interface Order { labels: string[]; directiveId: string | null; directiveStepId: string | null; - contractId: string | null; + directiveName: string | null; repositoryUrl: string | null; createdAt: string; updatedAt: string; @@ -3313,8 +3313,7 @@ export interface CreateOrderRequest { status?: OrderStatus; orderType?: OrderType; labels?: string[]; - directiveId?: string | null; - contractId?: string | null; + directiveId: string; repositoryUrl?: string | null; } @@ -3327,7 +3326,6 @@ export interface UpdateOrderRequest { labels?: string[]; directiveId?: string | null; directiveStepId?: string | null; - contractId?: string | null; repositoryUrl?: string | null; } @@ -3336,14 +3334,14 @@ export async function listOrders( type?: OrderType, priority?: OrderPriority, directiveId?: string, - contractId?: string, + search?: string, ): Promise<OrderListResponse> { const params = new URLSearchParams(); if (status) params.set("status", status); if (type) params.set("type", type); if (priority) params.set("priority", priority); if (directiveId) params.set("directiveId", directiveId); - if (contractId) params.set("contractId", contractId); + if (search) params.set("search", search); const qs = params.toString(); const res = await authFetch(`${API_BASE}/api/v1/orders${qs ? `?${qs}` : ""}`); if (!res.ok) throw new Error(`Failed to list orders: ${res.statusText}`); @@ -3391,21 +3389,9 @@ export async function linkOrderToDirective(orderId: string, directiveId: string) return res.json(); } -export async function linkOrderToContract(orderId: string, contractId: string): Promise<Order> { - const res = await authFetch(`${API_BASE}/api/v1/orders/${orderId}/link-contract`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ contractId }), - }); - if (!res.ok) throw new Error(`Failed to link order to contract: ${res.statusText}`); - return res.json(); -} - -export async function convertOrderToStep(orderId: string, directiveId: string): Promise<DirectiveStep> { +export async function convertOrderToStep(orderId: string): Promise<DirectiveStep> { const res = await authFetch(`${API_BASE}/api/v1/orders/${orderId}/convert-to-step`, { method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ directiveId }), }); if (!res.ok) throw new Error(`Failed to convert order to step: ${res.statusText}`); return res.json(); |
