You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We might be able to solve for this by checking if the value is a number first, and if it isn't default to a "date", as numbers and dates are the only two types you can use with greater than / between
Preflight Checklist
Describe the Bug
Currently, the generate joi function relies on Joi's number type to create the validation rules:
directus/packages/shared/src/utils/generate-joi.ts
Lines 165 to 171 in 67215b1
This fails when the value to compare against is a string (like
2021-09-21
) withError: limit must be a number or reference
.This is different from permissions, where the filter is applied as a query in SQL, which does accept this difference.
To Reproduce
Try using dates in validation with a gte/between etc type field, for example:
What version of Directus are you using?
v9.0.0-rc.93
What version of Node.js are you using?
16.4
What database are you using?
Postgres
What browser are you using?
Safari
What operating system are you using?
macOS
How are you deploying Directus?
Locally
The text was updated successfully, but these errors were encountered: