POST
export const MyDocumentPostCall = () => {
const { call, result, loading, isCompleted, reset } = useFrapePostDocCall(
/** method **/
'frappe.client.set_value'
);
const generateRandomNumber = () => {
call({
//** params **/
doctype: 'User',
name: 'Administrator',
fieldname: 'interest',
value: Math.random(),
});
};
const resetCall = () => {
reset();
};
if (loading) {
return <>Loading</>;
}
if (error) {
return <>{JSON.stringify(error)}</>;
}
if (result) {
return <p>{result}</p>;
}
return null;
};