export type DeleteApiApiPersonsPersonIdAssociatedServiceProvidersServiceProviderIdArgs = {personId: string, serviceProviderId: string}; export type DeleteApiApiPersonsPersonIdAssociatedServiceProvidersServiceProviderIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete the service provider association between this person and the service provider. * * DELETE /api/persons/{personId}/associatedServiceProviders/{serviceProviderId} */ export const deleteApiApiPersonsPersonIdAssociatedServiceProvidersServiceProviderId = async (args: DeleteApiApiPersonsPersonIdAssociatedServiceProvidersServiceProviderIdArgs, options: DeleteApiApiPersonsPersonIdAssociatedServiceProvidersServiceProviderIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/persons/${encodeURIComponent(String(args.personId))}/associatedServiceProviders/${encodeURIComponent(String(args.serviceProviderId))}${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 };