Closed fnoquiq closed 4 years ago
When using the following code: schema.number([rules.range(10, 100)]), an error appears.
schema.number([rules.range(10, 100)])
The error: Property 'range' does not exist on type 'Rules'.ts(2339).
Property 'range' does not exist on type 'Rules'.ts(2339)
I'm following the same tutorial on the site -> https://preview.adonisjs.com/guides/validator/schema-types
{ "@adonisjs/ace": "^6.0.0", "@adonisjs/auth": "^4.2.4", "@adonisjs/core": "^5.0.0-preview-rc", "@adonisjs/fold": "^6.0.0", "@adonisjs/lucid": "^8.2.2", }
Nodejs: 12.18.2 Npm: 6.14.5 Yarn: 1.22.4
Nodejs: 12.18.2
Npm: 6.14.5
Yarn: 1.22.4
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' import { schema, rules } from '@ioc:Adonis/Core/Validator' export default class StoreValidator { constructor(private ctx: HttpContextContract) { } public schema = schema.create({ testNumber: schema.number([rules.unsigned(), rules.range(10, 100)]) }) public cacheKey = this.ctx.routeKey public messages = {} }
Sample repo -> https://github.com/fnoquiq/adonis-validator-issue-range-example
Thanks for reporting. Seems to be missing
Can I make a PR? @thetutlage
Sure, feel free to do that. I will release it right away
Here it is @thetutlage #89 :)
When using the following code:
schema.number([rules.range(10, 100)])
, an error appears.The error:
Property 'range' does not exist on type 'Rules'.ts(2339)
.I'm following the same tutorial on the site -> https://preview.adonisjs.com/guides/validator/schema-types
Package version
Node.js and npm version
Nodejs: 12.18.2
Npm: 6.14.5
Yarn: 1.22.4
Sample Code (to reproduce the issue)
BONUS (a sample repo to reproduce the issue)
Sample repo -> https://github.com/fnoquiq/adonis-validator-issue-range-example