handleUpdateTenant method
Handles the update of tenant data.
Fetches the list of tenants from the repository and triggers TenantLoadedEvent with the fetched tenants. If an error occurs, it catches the error.
Implementation
Future<void> handleUpdateTenant() async {
await portalRepo.listTenant().then((tenants) {
add(TenantLoadedEvent(tenants));
}).catchError((error) {
if (error is Exception) {
// Handle exception
}
});
}