export type ResendStaffInvitesRequest = {teamInviteCodes: Array}; export type CreateApiV4OrganizationsTeamInvitesResendArgs = {body: ResendStaffInvitesRequest}; export type CreateApiV4OrganizationsTeamInvitesResendOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resend any unaccepted staff invites for the ids * * POST /v4/organizations/team/invites/resend */ export const createApiV4OrganizationsTeamInvitesResend = async (args: CreateApiV4OrganizationsTeamInvitesResendArgs, options?: CreateApiV4OrganizationsTeamInvitesResendOptions) => { const {baseUrl = "https://submittable-api.submittable.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v4/organizations/team/invites/resend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };