refactor: add successOr, sweep remaining inline unwraps (RD-17)
Eight sites hand-rolled `rd.tag === 'Success' ? rd.value : fallback`. Six take the new `successOr(rd, fallback)`, one takes the existing `successOf`, and one (`big-profile.store.ts`) uses the existing `map`, since it returns a RemoteData rather than an unwrapped value. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { AlertComponent } from '@shared/ui/alert/alert.component';
|
||||
import { ButtonComponent } from '@shared/ui/button/button.component';
|
||||
import { ASYNC } from '@shared/ui/async/async.component';
|
||||
import { AccessStore } from '@shared/application/access.store';
|
||||
import { successOr } from '@shared/application/remote-data';
|
||||
import { AuditStore } from '@beheer/application/audit.store';
|
||||
|
||||
/**
|
||||
@@ -94,10 +95,7 @@ export class AuditPage {
|
||||
protected access = inject(AccessStore);
|
||||
|
||||
protected canRead = computed(() => this.access.can('cases:manage'));
|
||||
protected entries = computed(() => {
|
||||
const rd = this.store.entries();
|
||||
return rd.tag === 'Success' ? rd.value : [];
|
||||
});
|
||||
protected entries = computed(() => successOr(this.store.entries(), []));
|
||||
|
||||
protected heading = $localize`:@@audit.heading:Auditlog`;
|
||||
protected intro = $localize`:@@audit.intro:Toegangs- en inzagebeslissingen (autorisatie en het tonen van afgeschermde gegevens). Vastgelegd zonder persoonsgegevens.`;
|
||||
|
||||
Reference in New Issue
Block a user