export type DeleteApiV4SubmissionsSubmissionIdLabelsLabelIdArgs = {submissionId: string, labelId: string}; export type DeleteApiV4SubmissionsSubmissionIdLabelsLabelIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a label from a submission * * DELETE /v4/submissions/{submissionId}/labels/{labelId} */ export const deleteApiV4SubmissionsSubmissionIdLabelsLabelId = async (args: DeleteApiV4SubmissionsSubmissionIdLabelsLabelIdArgs, options?: DeleteApiV4SubmissionsSubmissionIdLabelsLabelIdOptions) => { const {baseUrl = "https://submittable-api.submittable.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v4/submissions/${encodeURIComponent(String(args.submissionId))}/labels/${encodeURIComponent(String(args.labelId))}${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 };