We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 709cfed commit 8724d0eCopy full SHA for 8724d0e
src/utils/convert-filter.ts
@@ -1,6 +1,8 @@
1
import escape from 'escape-regexp';
2
import { Op } from 'sequelize';
3
4
+const uuidRegex = /^[0-9A-F]{8}-[0-9A-F]{4}-[5|4|3|2|1][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
5
+
6
const convertFilter = (filter) => {
7
if (!filter) {
8
return {};
@@ -13,7 +15,7 @@ const convertFilter = (filter) => {
13
15
const previousValue = memo[property.name()] || {};
14
16
switch (property.type()) {
17
case 'string': {
- if (property.sequelizePath.values) {
18
+ if (property.sequelizePath.values || uuidRegex.test(value.toString())) {
19
return {
20
[property.name()]: { [Op.eq]: `${escape(value)}` },
21
...memo,
0 commit comments