onDimensionGroupRevisionDelete
Dimension group revision deletion handler
This example demonstrates how the onDimensionGroupRevisionDelete callback
sends a request using the Fetch API to delete a dimension group revision. Once the request completes, the result is returned to the widget through the
onResponse
callback.
Dimension group revision deletion handler
onDimensionGroupRevisionDelete: (
group: DIQ_DimensionGroupRevision,
onResponse: (result: DIQ_Result) => void
) => {
fetch(`/api/dimension-groups/${group.key}`, {
method: "DELETE"
})
.then(() => {
onResponse({ success: true });
})
.catch((error) => {
onResponse({ success: false, error });
});
};