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

IsCurrency symbol validation error #598

Closed
btd1337 opened this issue Apr 30, 2020 · 7 comments
Closed

IsCurrency symbol validation error #598

btd1337 opened this issue Apr 30, 2020 · 7 comments
Labels
comp: validator.js Changes affecting validator.js. status: invalid / expired Issues with no action to take. type: fix Issues describing a broken feature.

Comments

@btd1337
Copy link

btd1337 commented Apr 30, 2020

Hi devs,

I'm trying use BRL currency in @IsCurrency options, but when I use this setting the validator fails:

{
	symbol: 'R$',
	require_symbol: true,
	allow_space_after_symbol: true,
	symbol_after_digits: false,
	allow_negatives: false,
	parens_for_negatives: false,
	negative_sign_before_digits: false,
	negative_sign_after_digits: false,
	allow_negative_sign_placeholder: false,
	thousands_separator: '.',
	decimal_separator: ',',
	allow_decimal: true,
	require_decimal: true,
	digits_after_decimal: [2],
	allow_space_after_digits: false,
}

Value: R$ 1.400,00

"statusCode": 400,
    "message": [
        "monthyMoneyGoal must be a currency"
    ],
    "error": "Bad Request"

But changing symbol to $ it works:

{
	symbol: 'R$',
	require_symbol: true,
	allow_space_after_symbol: true,
	symbol_after_digits: false,
	...
}

Value: $ 1.400,00

"statusCode": 200,
    "message": [
        "Successful update"
    ],

Changing symbol to $R it unbelievably too works!

Why? Where is error?

PS: My app uses single quotes in Prettier Formatter

@btd1337 btd1337 changed the title Is currency symbol validation error IsCurrency symbol validation error Apr 30, 2020
@vlapo
Copy link
Contributor

vlapo commented Apr 30, 2020

Doesnt look like class-validator problem. We use validatorjs isCurrency function. You have to create issue here - https://github.com/validatorjs/validator.js

@btd1337
Copy link
Author

btd1337 commented May 4, 2020

@vlapo The issue validatorjs/validator.js#1292 was opened.

@vlapo
Copy link
Contributor

vlapo commented May 4, 2020

Thank you! Lets see what validator.js maintainers will says.

@vlapo vlapo added status: awaiting answer Awaiting answer from the author of issue or PR. type: fix Issues describing a broken feature. labels May 4, 2020
@btd1337
Copy link
Author

btd1337 commented May 20, 2020

@vlapo Fixed in: validatorjs/validator.js#1306

What is the next step?

@vlapo vlapo added comp: validator.js Changes affecting validator.js. and removed status: awaiting answer Awaiting answer from the author of issue or PR. labels Jul 21, 2020
@vlapo
Copy link
Contributor

vlapo commented Jul 21, 2020

@btd1337 now we have to update validato.js :) I will try release new version with updated dependencies soon.

@NoNameProvided NoNameProvided added the status: invalid / expired Issues with no action to take. label Dec 9, 2022
@NoNameProvided
Copy link
Member

Closing this as expired. If you still encounter this error please open a new issue with a minimal reproducible example showcasing your problem. The example should:

  • be as short as possible while clearly showcasing the problem
  • has no external dependencies, only this lib
  • the expected and actual behavior should be explained

@github-actions
Copy link

github-actions bot commented Jan 9, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
comp: validator.js Changes affecting validator.js. status: invalid / expired Issues with no action to take. type: fix Issues describing a broken feature.
Development

No branches or pull requests

3 participants