export type GetApiReportsPettyCashesOtherClaimClaimIdArgs = {reprint?: (0 | 1) | undefined, claim_id: number}; export type GetApiReportsPettyCashesOtherClaimClaimIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * View other claim report * * GET /reports/petty_cashes/other_claim/{claim_id} */ export const getApiReportsPettyCashesOtherClaimClaimId = async (args: GetApiReportsPettyCashesOtherClaimClaimIdArgs, options?: GetApiReportsPettyCashesOtherClaimClaimIdOptions) => { const {baseUrl = "http://api.gostarmartbus.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.reprint != null) query.append("reprint", String(args.reprint)) const url = `${baseUrl.replace(/\/+$/, '')}/reports/petty_cashes/other_claim/${encodeURIComponent(String(args.claim_id))}${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 };