@hedhog/prisma 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,7 @@ let PrismaService = class PrismaService extends client_1.PrismaClient {
26
26
  const searchValue = paginationParams.search;
27
27
  const OR = [];
28
28
  fields.forEach((field) => {
29
- if (field === 'id' && !isNaN(+searchValue)) {
29
+ if (field === 'id' && !isNaN(+searchValue) && +searchValue > 0) {
30
30
  OR.push({ id: { equals: +searchValue } });
31
31
  }
32
32
  else if (field === 'method' &&
@@ -41,7 +41,7 @@ let PrismaService = class PrismaService extends client_1.PrismaClient {
41
41
  OR.push(condition);
42
42
  }
43
43
  });
44
- if (!isNaN(+searchValue)) {
44
+ if (!isNaN(+searchValue) && +searchValue > 0) {
45
45
  OR.push({ id: { equals: +searchValue } });
46
46
  }
47
47
  return OR;
@@ -1 +1 @@
1
- {"version":3,"file":"prisma.service.js","sourceRoot":"","sources":["../src/prisma.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA0D;AAC1D,2CAA8C;AAGvC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,qBAAY;IAC7C,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACxB,CAAC;IAED,WAAW;QACT,OAAQ,IAAY,CAAC,aAAa,CAAC,cAAc,CAAC;IACpD,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC;IAC7C,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;IACxC,CAAC;IAED,uBAAuB,CACrB,MAAgB,EAChB,gBAAoC;QAEpC,MAAM,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC5C,MAAM,EAAE,GAAU,EAAE,CAAC;QAErB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,C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AAI,GAAG,aAAa,CAAC;gBACjD,CAAC;gBAED,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACrB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;YAC7C,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAA;AAnDY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAmDzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/prisma",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
27
27
  const OR: any[] = [];
28
28
 
29
29
  fields.forEach((field) => {
30
- if (field === 'id' && !isNaN(+searchValue)) {
30
+ if (field === 'id' && !isNaN(+searchValue) && +searchValue > 0) {
31
31
  OR.push({ id: { equals: +searchValue } });
32
32
  } else if (
33
33
  field === 'method' &&
@@ -47,7 +47,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
47
47
  }
48
48
  });
49
49
 
50
- if (!isNaN(+searchValue)) {
50
+ if (!isNaN(+searchValue) && +searchValue > 0) {
51
51
  OR.push({ id: { equals: +searchValue } });
52
52
  }
53
53