Skip to content
Discussion options

You must be logged in to vote

Okay, I finally fixed my issue. Here's the full explanation of the issue.

Imagine that you have a User model like the following :

class User extends BaseModel {
 @column({ isPrimary: true })
  public id: number

  @column()
  public email: string

  @column({ serializeAs: null })
  public password: string

  @column({ serializeAs: 'firstName' })
  public firstName: string
}

Now, imagine that I allow my user to create an account without indicating the firstName. For this, I would have something along those lines in my controller :

export default class AuthController {
  public async register({ auth, logger, request, response }: HttpContextContract) {
    const validationSchema = schema.create

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@a-coruble
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by a-coruble
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants