Перейти к основному содержимому

useCancelMaintenance

@mineflow/client-react


@mineflow/client-react / EAM / useCancelMaintenance

Function: useCancelMaintenance()

function useCancelMaintenance(): UseMutationResult<{
assetId: string;
cancellationReason: string | null;
cancelledAt: string | null;
cancelledBy: string | null;
completedAt: string | null;
id: string;
kind: MaintenanceRecordResponse_OutputKind;
meterAtCompleted: number | null;
meterAtScheduled: number | null;
normCode: string | null;
performedBy: string;
reason: string;
scheduledAt: string;
startedAt: string | null;
status: MaintenanceRecordResponse_OutputStatus;
}, Error, {
id: string;
reason: string;
}>;

Defined in: client-react/src/domain-hooks/eam.ts:336

Отмена ТО из scheduled/inProgress (POST /eam/maintenance/:id/cancel). reason обязателен. Авто-Idempotency-Key. На успехе инвалидирует список ТО.

Returns​

UseMutationResult<{ assetId: string; cancellationReason: string | null; cancelledAt: string | null; cancelledBy: string | null; completedAt: string | null; id: string; kind: MaintenanceRecordResponse_OutputKind; meterAtCompleted: number | null; meterAtScheduled: number | null; normCode: string | null; performedBy: string; reason: string; scheduledAt: string; startedAt: string | null; status: MaintenanceRecordResponse_OutputStatus; }, Error, { id: string; reason: string; }>

UseMutationResult — mutate({ id, reason }).