Skip to content

Commit

Permalink
do not show register action after a record already has a register action
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Dec 14, 2024
1 parent a1d81ba commit cf4c1d4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,12 @@ export const tennisClubMembershipEvent = defineConfig({
id: 'event.tennis-club-membership.action.register.label'
},
allowedWhen: defineConditional(

Check failure on line 263 in src/form/tennis-club-membership.ts

View workflow job for this annotation

GitHub Actions / test

Type '{ type: "REGISTER"; label: { defaultMessage: string; description: string; id: string; }; allowedWhen: any; forms: any[]; }' is not assignable to type '{ type: "CREATE"; label: { id: string; description: string; defaultMessage: string; }; forms: { active: boolean; version: { id: string; label: { id: string; description: string; defaultMessage: string; }; }; label: { ...; }; pages: { ...; }[]; }[]; } | { ...; } | { ...; }'.
or(
eventHasAction('VALIDATE'),
and(eventHasAction('DECLARE'), userHasScope('register'))
and(
or(
eventHasAction('VALIDATE'),
and(eventHasAction('DECLARE'), userHasScope('register'))
),
not(eventHasAction('REGISTER'))
)
),
forms: [TENNIS_CLUB_FORM]
Expand Down

0 comments on commit cf4c1d4

Please sign in to comment.