Route validator unique rule on update

#1

How to copy behavior described here:

'use strict'

class User extends Lucid {

  static rules (userId) {
    return {
      email: `unique:users,email,id,${userId}`
    }
  }

}

For route validator?

0 Likes

#2

How are you planning to access the userId in route validator?

0 Likes

#3

That’s the thing I was thinking about.
So in terms of update validation, it has to be done in controller

0 Likes