diff --git a/package-lock.json b/package-lock.json index 30430198..bb0c3988 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,13 +39,13 @@ "cadt": "build/server.js" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", - "@babel/plugin-syntax-import-attributes": "^7.23.3", - "@babel/preset-env": "^7.24.0", + "@babel/cli": "^7.24.1", + "@babel/core": "^7.24.4", + "@babel/plugin-syntax-import-attributes": "^7.24.1", + "@babel/preset-env": "^7.24.4", "@babel/register": "^7.23.7", "@commitlint/cli": "^19.2.1", - "@commitlint/config-conventional": "^19.0.3", + "@commitlint/config-conventional": "^19.1.0", "babel-plugin-module-resolver": "^5.0.0", "chai": "^5.1.0", "chai-http": "^4.4.0", @@ -53,7 +53,7 @@ "eslint-plugin-es": "^4.1.0", "eslint-plugin-mocha": "^10.4.1", "husky": "^9.0.11", - "mocha": "^10.3.0", + "mocha": "^10.4.0", "semver": "^7.6.0", "sinon": "^17.0.1", "socket.io-client": "^4.7.5", @@ -11373,7 +11373,6 @@ "version": "0.19.3", "resolved": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz", "integrity": "sha512-8IfgFctB7fkvqkTGF2MnrDrC6vzE28Wcc1aSbdDQ+4/WFtzfS73YuapbuaPZwGqpR2e0EeDMIrFOJubQVLWFNA==", - "license": "Apache-2.0", "bin": { "xlsx": "bin/xlsx.njs" }, diff --git a/package.json b/package.json index 7984f894..497b74ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cadt", - "version": "1.7.13", + "version": "1.7.14", "_comment": "DONT CHANGE MAJOR UNLESS DATAMODEL CHANGES: The major version corresponds to the datamodel version your using, so 2.0.0 means it'll use datamodel v2", "private": true, "bin": "build/server.js", @@ -59,13 +59,13 @@ "winston-daily-rotate-file": "^4.7.1" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", - "@babel/plugin-syntax-import-attributes": "^7.23.3", - "@babel/preset-env": "^7.24.0", + "@babel/cli": "^7.24.1", + "@babel/core": "^7.24.4", + "@babel/plugin-syntax-import-attributes": "^7.24.1", + "@babel/preset-env": "^7.24.4", "@babel/register": "^7.23.7", "@commitlint/cli": "^19.2.1", - "@commitlint/config-conventional": "^19.0.3", + "@commitlint/config-conventional": "^19.1.0", "babel-plugin-module-resolver": "^5.0.0", "chai": "^5.1.0", "chai-http": "^4.4.0", @@ -73,7 +73,7 @@ "eslint-plugin-es": "^4.1.0", "eslint-plugin-mocha": "^10.4.1", "husky": "^9.0.11", - "mocha": "^10.3.0", + "mocha": "^10.4.0", "semver": "^7.6.0", "sinon": "^17.0.1", "socket.io-client": "^4.7.5", diff --git a/src/controllers/units.controller.js b/src/controllers/units.controller.js index 8bb58a23..71fce45a 100644 --- a/src/controllers/units.controller.js +++ b/src/controllers/units.controller.js @@ -250,7 +250,10 @@ export const findAll = async (req, res) => { } where.marketplace = { - [Sequelize.Op.not]: 'Tokenized on Chia', + [Sequelize.Op.or]: [ + { [Sequelize.Op.is]: null }, + { [Sequelize.Op.not]: 'Tokenized on Chia' }, + ], }; } diff --git a/src/validations/projects.validations.js b/src/validations/projects.validations.js index dd6a372e..4eba441a 100644 --- a/src/validations/projects.validations.js +++ b/src/validations/projects.validations.js @@ -62,7 +62,7 @@ export const baseSchema = { export const projectsGetQuerySchema = Joi.object({ page: Joi.number().optional(), - limit: Joi.number().max(100).min(1).optional(), + limit: Joi.number().max(1000).min(1).optional(), search: Joi.string().optional(), columns: Joi.array().items(Joi.string()).single().optional(), orgUid: Joi.string().optional(), @@ -76,6 +76,7 @@ export const projectsGetQuerySchema = Joi.object({ Joi.alternatives([ Joi.object({ projectIds: Joi.string().required() }).unknown(), Joi.object({ warehouseProjectId: Joi.string().required() }).unknown(), + Joi.object({ xls: Joi.string().required() }).unknown(), ]), { then: Joi.object({ diff --git a/src/validations/units.validations.js b/src/validations/units.validations.js index 21e07bfa..25171509 100644 --- a/src/validations/units.validations.js +++ b/src/validations/units.validations.js @@ -55,7 +55,7 @@ export const unitsPostSchema = Joi.object({ export const unitsGetQuerySchema = Joi.object({ page: Joi.number().min(1).required(), - limit: Joi.number().max(100).min(1).required(), + limit: Joi.number().max(1000).min(1).required(), search: Joi.string(), warehouseUnitId: Joi.string(), columns: Joi.array().items(Joi.string()).single(), @@ -83,6 +83,12 @@ export const unitsGetQuerySchema = Joi.object({ limit: Joi.number().max(100).min(1).optional(), }), }) + .when(Joi.object({ xls: Joi.exist() }).unknown(), { + then: Joi.object({ + page: Joi.number().min(1).optional(), + limit: Joi.number().max(100).min(1).optional(), + }), + }) .and('page', 'limit'); export const unitsUpdateSchema = Joi.object({