mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-02 16:43:13 +00:00
feat(work-orders): add media content API path
This commit is contained in:
parent
4006145ef8
commit
599e38aae3
2 changed files with 9 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ export const API_PATHS = {
|
|||
media: (id: string | number) => `workorders/${id}/media`,
|
||||
mediaItem: (id: string | number, mediaId: string | number) =>
|
||||
`workorders/${id}/media/${mediaId}`,
|
||||
mediaContent: (id: string | number, mediaId: string | number) =>
|
||||
`workorders/${id}/media/${mediaId}/content`,
|
||||
completionDoc: (id: string | number) => `workorders/${id}/completion-doc`,
|
||||
uplifts: (id: string | number) => `workorders/${id}/uplifts`,
|
||||
upliftCancel: (workOrderId: string | number, upliftId: string | number) =>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ vi.mock("@/api/api", () => ({
|
|||
patch: (...args: unknown[]) => apiPatchFn(...args),
|
||||
post: (...args: unknown[]) => apiPostFn(...args),
|
||||
delete: (...args: unknown[]) => apiDeleteFn(...args),
|
||||
get: (...args: unknown[]) => apiGetFn(...args),
|
||||
},
|
||||
}));
|
||||
|
||||
|
|
@ -895,3 +896,9 @@ describe("workOrdersApi.fetchVendorsDropdown", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("API_PATHS.workOrder.mediaContent", () => {
|
||||
it("builds the authorized media content path", () => {
|
||||
expect(API_PATHS.workOrder.mediaContent(10, 12)).toBe("workorders/10/media/12/content");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue