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

useUpdateAssetComponent

@mineflow/client-react


@mineflow/client-react / EAM / useUpdateAssetComponent

Function: useUpdateAssetComponent()

function useUpdateAssetComponent(assetId: string): UseMutationResult<{
assetId: string;
id: string;
installedAt: string | null;
kind: string;
name: string;
note: string | null;
state: AssetComponent_OutputState;
warrantyUntil: string | null;
}, Error, {
body: {
installedAt?: string | null;
kind?: string;
name?: string;
note?: string | null;
state?: UpdateAssetComponentDtoState;
warrantyUntil?: string | null;
};
componentId: string;
}>;

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

Обновление узла (PATCH), в т.ч. смена состояния. Авто-Idempotency-Key; на успехе инвалидирует список узлов.

Parameters​

ParameterType
assetIdstring

Returns​

UseMutationResult<{ assetId: string; id: string; installedAt: string | null; kind: string; name: string; note: string | null; state: AssetComponent_OutputState; warrantyUntil: string | null; }, Error, { body: { installedAt?: string | null; kind?: string; name?: string; note?: string | null; state?: UpdateAssetComponentDtoState; warrantyUntil?: string | null; }; componentId: string; }>

UseMutationResult — mutate({ componentId, body }).