Skip to content

Event Banner

singularName: event-bannerpluralName: event-banners

Stores the data for the Event Banners shown on the Homepage. Can be related to a run

Schema

NameTypeDetails
teaser_textstring
banner_imagemedia
start_datedate
end_datedate
event_textrichtext
runrelationoneToOne → Hareline

Lifecycles

beforeCreate (async)

Before creating an event banner, check that the start date is before the end date and that there isn't already an event banner for the same period. Throws an application error if either of these checks fail

Parameters:

  • event: - Lifecycle event

beforeUpdate (async)

This lifecycle method is triggered before updating an event banner entry. It ensures that the start date is before the end date and checks for any existing event banners that overlap with the new dates, excluding the current entry. Throws an error if the date validation fails or if there is an overlapping event banner.

Parameters:

  • event: - The event object containing the parameters for the updated event banner entry.

Released under the MIT License.