export type DeleteApiV4OrganizationsTeamArgs = {'userId[]'?: Array | undefined}; export type DeleteApiV4OrganizationsTeamOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove Team Members from an Organization * * DELETE /v4/organizations/team */ export const deleteApiV4OrganizationsTeam = async (args: DeleteApiV4OrganizationsTeamArgs, options?: DeleteApiV4OrganizationsTeamOptions) => { const {baseUrl = "https://submittable-api.submittable.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() for (const item of args['userId[]'] ?? []) query.append("userId[]", String(item)) const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/team${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 };