export type GetApiApiGetCategoryListArgs = {token: string}; export type GetApiApiGetCategoryListOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get category list for authenticated user * * GET /api/get-Category-List */ export const getApiApiGetCategoryList = async (args: GetApiApiGetCategoryListArgs, options: GetApiApiGetCategoryListOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) const url = `${baseUrl.replace(/\/+$/, '')}/api/get-Category-List${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 };