18 lines
626 B
TypeScript
18 lines
626 B
TypeScript
import { CrudClient } from "../infra/crud-client"
|
|
import type { ApiClientOptions } from "../infra/client"
|
|
import type { ApiPath } from "../infra/types"
|
|
|
|
export const PURCHASE_ORDER_ROUTES = {
|
|
INDEX: "/api/purchase-orders",
|
|
BY_ID: "/api/purchase-orders/{id}",
|
|
} as const satisfies Record<string, ApiPath>
|
|
|
|
export class PurchaseOrdersClient extends CrudClient<
|
|
typeof PURCHASE_ORDER_ROUTES.INDEX,
|
|
typeof PURCHASE_ORDER_ROUTES.BY_ID
|
|
> {
|
|
constructor(baseUrl?: string, defaultOptions?: ApiClientOptions) {
|
|
super(baseUrl, defaultOptions, PURCHASE_ORDER_ROUTES.INDEX, PURCHASE_ORDER_ROUTES.BY_ID)
|
|
}
|
|
}
|