onListZones
Zone listing handler
This example demonstrates how the onListZones callback
retrieves all zones for a project from the host application's persistent storage. Once the zones have been retrieved, they are returned to the widget through the
onResponse
callback.
Zone listing handler
onListZones: (projectKey: string, onResponse: (result: DIQ_Result, zones: Array<DIQ_Zone> | null) => void) => {
// Retrieve all zones for the project
const zones = database.getZones(projectKey);
// Return the zones to the widget
onResponse(
{ success: true },
zones
);
};