feat(portal-beheer): catalogus viewer loads published zaaktypen from the BFF (refs #130)
This commit is contained in:
@@ -21,6 +21,25 @@ export class CatalogusPage {
|
|||||||
protected readonly failed = signal(false);
|
protected readonly failed = signal(false);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// ponytail: stub for the red test; the real load lands in the green commit.
|
this.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
load(): void {
|
||||||
|
this.loading.set(true);
|
||||||
|
this.failed.set(false);
|
||||||
|
this.bff.getBeheerCatalogiZaaktypen().subscribe({
|
||||||
|
next: (rows: BeheerZaaktype[]) => {
|
||||||
|
this.items.set(rows);
|
||||||
|
this.loading.set(false);
|
||||||
|
this.loaded.set(true);
|
||||||
|
},
|
||||||
|
// Surface the failure (e.g. 403 for a non-beheerder) instead of swallowing it.
|
||||||
|
error: () => {
|
||||||
|
this.items.set([]);
|
||||||
|
this.loading.set(false);
|
||||||
|
this.loaded.set(true);
|
||||||
|
this.failed.set(true);
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user