instant-harlequinI
Refine2y ago
8 replies
instant-harlequin

handclick button

How to perform a confirmation or validate an action before handleSave operation, in this code: const handleClick = async () => {
mutateUpdate({
resource: "rqp-requisicaos",
id: params.id!,
values: {
createnota: 1,
notaNumber: 1 - - ${totalId?.total},
//notaNumberYear: notaNumero ,
nota_datecreated: currentDate,
notaCreatedBy: identity?.id,

},
mutationMode: "optimistic",
invalidates: [/*"list", "many", */"detail"],
successNotification: false,
errorNotification: false,
});
}

const {
id,
status,
userId,
cod,
createdAt,
createnota
} = data?.data isFetching;

const pdfOpenHandler = async () => {
await refetch();
show();
};

if ( createnota === true ) {

return (
<>
<Button
loading={loading}
onClick={handleClick}
type="primary"
icon={<FilePdfOutlined />}
>
Create
</Button>
</>
);
}
Was this page helpful?