"use client"

import api from "@shared/api"

const CANCEL_MESSAGE = "Отменено пользователем"

export const useCancelJob = () => {
	return api.useMutation("patch", "/api/jobs/jobs/{job_id}/", {
	})
}

export const buildCancelJobPayload = (jobId: string) => ({
	params: { path: { job_id: jobId } },
	body: {
		status: "CANCELLED" as const,
		current_message: CANCEL_MESSAGE,
	},
})
