export type GetApiIntV1Erp2LookupsPerDiemCollectionMethodsArgs = {'company-id': string}; export type GetApiIntV1Erp2LookupsPerDiemCollectionMethodsOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * ERP-5894 — per-diem collection methods (dbo.DbPerDiemCollectionMethodRepo_GetAll). * `approverTypeId` is carried through because it drives who may approve the per diem, which * the JobApprover build already depends on. * * GET /int/v1/erp2/lookups/per-diem-collection-methods */ export const getApiIntV1Erp2LookupsPerDiemCollectionMethods = async (args: GetApiIntV1Erp2LookupsPerDiemCollectionMethodsArgs, options: GetApiIntV1Erp2LookupsPerDiemCollectionMethodsOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['company-id'] != null) headers.set("company-id", String(args['company-id'])) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/int/v1/erp2/lookups/per-diem-collection-methods${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };