vinejs / vine

VineJS is a form data validation library for Node.js
https://vinejs.dev
MIT License
1.05k stars 21 forks source link

`field` field of Adonis validation messages #46

Open Xstoudi opened 5 months ago

Xstoudi commented 5 months ago

Package version

2.0.0

Describe the bug

I created a unique rule for VineObject, but I don't really understand where I forgot to pass the field value on message object. I understand there is none by default, but is it possible to customize it?

 messages: [
    {
      message: 'The [section_id, rank] group is not unique',
      rule: 'uniqueComposed',
      field: ''
    }
  ]

For example, here I would like to show the error on the rank field in the frontend, so I would like field to equals rank.

Reproduction repo

No response

thetutlage commented 3 months ago

Can you share how you report the error and how this unique rule is used?