Skip to main content

onListDimensionGroupRevisions

Last updated 8/03/2026

Dimension group revision listing handler

This example demonstrates how the

callback sends a request using the Fetch API to retrieve dimension group revisions. Once the request completes, the result and returned revisions are provided to the widget through the

onResponse
callback.

TypeScript
Dimension group revision listing handler
onListDimensionGroupRevisions = async function(revision: DIQ_Revision, onResponse: (result: DIQ_Result, groups: Array<DIQ_DimensionGroupRevision> | null) => void ) {
try {
const res = await fetch(`/api/dimension-groups/${revision.key}/revisions`);

if (!res.ok) {
throw new Error(`HTTP ${res.status}`);
}

const revisions = await res.json();

onResponse({ ok: true }, revisions);
}
catch (err) {
onResponse(
{ ok: false, message: err.message || "Failed to fetch revisions" },
null
);
}
};