export type DeleteApiApiV2AccountsAccountIdNfcArgs = {accountId: string, collectorId?: number | undefined, passTypeId?: string | undefined}; export type DeleteApiApiV2AccountsAccountIdNfcOptions = {baseUrl?: string | undefined, mms?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a member account NFC token * * DELETE /api/v2/accounts/{accountId}/nfc */ export const deleteApiApiV2AccountsAccountIdNfc = async (args: DeleteApiApiV2AccountsAccountIdNfcArgs, options?: DeleteApiApiV2AccountsAccountIdNfcOptions) => { const {baseUrl = "https://mms.api.ed.ts.egym.coffee", fetch: fetchFn = fetch, mms} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.collectorId != null) query.append("collectorId", String(args.collectorId)) if (args.passTypeId != null) query.append("passTypeId", String(args.passTypeId)) if (mms !== undefined) headers.set("x-api-key", mms) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/accounts/${encodeURIComponent(String(args.accountId))}/nfc${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };