export type DeleteApiV2ProvidersEmployersEmployerIdUsersUserIdArgs = {employerId: string, userId: string, Authorization: string, Accept: string, transferNotificationsTo?: string | undefined}; export type DeleteApiV2ProvidersEmployersEmployerIdUsersUserIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * unlink employer user and employer * * DELETE /v2/providers/employers/{employerId}/users/{userId} */ export const deleteApiV2ProvidersEmployersEmployerIdUsersUserId = async (args: DeleteApiV2ProvidersEmployersEmployerIdUsersUserIdArgs, options?: DeleteApiV2ProvidersEmployersEmployerIdUsersUserIdOptions) => { const {baseUrl = "https://api.loket.nl", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args.transferNotificationsTo != null) query.append("transferNotificationsTo", String(args.transferNotificationsTo)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/providers/employers/${encodeURIComponent(String(args.employerId))}/users/${encodeURIComponent(String(args.userId))}${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 };