Skip to content

Commit

Permalink
Merge pull request #708 from DEFRA/feature/497169-forms-model-changes…
Browse files Browse the repository at this point in the history
…-for-optional-page-events

Make both onLoad and onSave page events optional
  • Loading branch information
davidjamesstone authored Feb 19, 2025
2 parents 9552bec + bdbe6ca commit e5a43b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions model/src/form/form-definition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ const eventSchema = Joi.object<Event>().keys({
})

const eventsSchema = Joi.object<Events>().keys({
onLoad: eventSchema,
onSave: eventSchema
onLoad: eventSchema.optional(),
onSave: eventSchema.optional()
})

/**
Expand Down
4 changes: 2 additions & 2 deletions model/src/form/form-definition/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export interface Event {
}

export interface Events {
onLoad: Event
onSave: Event
onLoad?: Event
onSave?: Event
}

export interface PageBase {
Expand Down

0 comments on commit e5a43b5

Please sign in to comment.