Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to make vine work with hyphenated column name #50

Closed
jasonejavier opened this issue May 6, 2024 · 5 comments
Closed

Question: How to make vine work with hyphenated column name #50

jasonejavier opened this issue May 6, 2024 · 5 comments
Assignees
Labels
Type: Bug The issue has indentified a bug

Comments

@jasonejavier
Copy link

jasonejavier commented May 6, 2024

Package version

^2.0.0

Describe the bug

On our AdonisJS model we have a hyphenated column name like this

Screenshot 2024-05-06 at 8 18 00 AM

And we declare it in our consts file like this:

Screenshot 2024-05-06 at 8 19 03 AM

Vine declaration

Screenshot 2024-05-06 at 8 19 34 AM

We're using the vinejs for checking the body for the CREATE request and when we're passing
"avs-address": "Sample Address",

it is giving us the error: SyntaxError: Missing initializer in const declaration

Can someone help with this? Thank you!

Reproduction repo

No response

@joao-pedro-braz
Copy link

Having the same issue, seems caused by a failure to compile the async function that validates the field

@RomainLanz RomainLanz added the Type: Bug The issue has indentified a bug label May 20, 2024
@RomainLanz RomainLanz self-assigned this May 20, 2024
@RomainLanz
Copy link
Member

Does that fix the issue when you convert the fields to camelCase?

https://vinejs.dev/docs/schema_101#converting-the-output-to-camelcase

@thetutlage
Copy link
Contributor

Not sure I entirely get the issue. So it will be nice to have a reproduction of the same

@RomainLanz
Copy link
Member

Not sure I entirely get the issue. So it will be nice to have a reproduction of the same

The code generated by Vine when using kebab-case field is invalid. The issue reside inside the compiler. Maybe we should normalize the casing of the field inside the generated code.

@thetutlage
Copy link
Contributor

The code generated by Vine when using kebab-case field is invalid

That is what I am trying to figure out. What is invalid?

  • Does it throw a runtime exception? If yes, what does that exception looks like?
  • Does it not validate the field altogether? If yes, will need a reproduction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue has indentified a bug
Projects
None yet
Development

No branches or pull requests

4 participants