export type DeleteApiV1UsersUserIdBlocksArgs = {user_id: number}; export type DeleteApiV1UsersUserIdBlocksOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unblock user * * DELETE /v1/users/{user_id}/blocks */ export const deleteApiV1UsersUserIdBlocks = async (args: DeleteApiV1UsersUserIdBlocksArgs, options?: DeleteApiV1UsersUserIdBlocksOptions) => { const {baseUrl = "http://localhost:3000", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/users/${encodeURIComponent(String(args.user_id))}/blocks${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 };