onDimensionsUpdate
Dimensions update handler
This example demonstrates how the onDimensionsUpdate callback
receives the updated DIQ_Dimension objects and saves them in the host application. Once completed, the result is returned to
the widget through the
onResponse
callback.
Dimensions update handler
onDimensionsUpdate: (
dimensions: Array<DIQ_Dimension>,
onResponse: (result: DIQ_Result) => void
) => {
fetch("/api/dimensions", {
method: "PUT",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({ dimensions })
})
.then(() => {
onResponse({ success: true });
})
.catch((error) => {
onResponse({ success: false, error });
});
};