export type DeleteApiTeamsTeamIdSchedulesDutyIdArgs = {teamId: string, dutyId: string}; export type DeleteApiTeamsTeamIdSchedulesDutyIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a specific duty. * * DELETE /teams/{teamId}/schedules/{dutyId} */ export const deleteApiTeamsTeamIdSchedulesDutyId = async (args: DeleteApiTeamsTeamIdSchedulesDutyIdArgs, options?: DeleteApiTeamsTeamIdSchedulesDutyIdOptions) => { const {baseUrl = "https://connect.signl4.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/teams/${encodeURIComponent(String(args.teamId))}/schedules/${encodeURIComponent(String(args.dutyId))}${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 };