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

useUpdateAsset

@mineflow/client-react


@mineflow/client-react / EAM / useUpdateAsset

Function: useUpdateAsset()

function useUpdateAsset(): UseMutationResult<{
assetClassId: string;
commissionedAt: string;
currentObjectId: string;
id: string;
inventoryNumber: string;
name: string;
passport: {
manufacturer: string | null;
model: string | null;
productionYear: number | null;
specifications: {
[key: string]: unknown;
};
techPassportNumber: string | null;
warrantyMonths: number | null;
warrantyTermsText: string | null;
warrantyUntil: string | null;
};
responsibleMechanicId: string | null;
status: AssetResponse_OutputStatus;
}, Error, {
body: {
name: string;
};
id: string;
}>;

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

Правка карточки актива: паспортное наименование из реестра заказчика. PATCH /eam/assets/:id. Инвентарный (гаражный) номер этим хуком не меняется — он natural key реестра и в тело запроса не входит. Авто-Idempotency-Key; на успехе инвалидирует карточку и список активов.

Returns​

UseMutationResult<{ assetClassId: string; commissionedAt: string; currentObjectId: string; id: string; inventoryNumber: string; name: string; passport: { manufacturer: string | null; model: string | null; productionYear: number | null; specifications: { [key: string]: unknown; }; techPassportNumber: string | null; warrantyMonths: number | null; warrantyTermsText: string | null; warrantyUntil: string | null; }; responsibleMechanicId: string | null; status: AssetResponse_OutputStatus; }, Error, { body: { name: string; }; id: string; }>

UseMutationResult — mutate({ id, body: UpdateAssetBody }).