Adding other params in Adonis Hooks

Is there a way to add another param in a hook method?
For example, I want to set the start date and end date by a duration before saving. Let’s say x days.

The duration shouldn’t be saved into the database.

EventHook.setStartEndDate = async (event, duration) => {

  const now = moment()
  const startDate = now.format('YYYY-mm-dd')
  const endDate = moment(now).add(duration, 'days').format('YYYY-mm-dd')

  event.start_date = startDate
  event.end_date = endDate
}

@xiandalisay

Hi!

I’m not quite sure do you mean https://adonisjs.com/docs/4.1/database-hooks#_binding_closure ?
I don’t think you can add extra parameters in there…

But you should be able to add it to event and delete it from event before saving it into database