diff --git a/package.json b/package.json index 91d7aa93..0a25ae9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "core-registry-cadt", - "version": "1.7.8", + "version": "1.7.9", "_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", diff --git a/src/controllers/units.controller.js b/src/controllers/units.controller.js index 0b16adb6..b1a104f5 100644 --- a/src/controllers/units.controller.js +++ b/src/controllers/units.controller.js @@ -263,7 +263,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 f15cc053..c64aae89 100644 --- a/src/validations/projects.validations.js +++ b/src/validations/projects.validations.js @@ -63,7 +63,7 @@ export const baseSchema = { export const projectsGetQuerySchema = Joi.object() .keys({ page: Joi.number().min(1), - limit: Joi.number().max(100).min(1), + limit: Joi.number().max(1000).min(1), search: Joi.string(), columns: Joi.array().items(Joi.string()).single(), orgUid: Joi.string(), @@ -74,6 +74,12 @@ export const projectsGetQuerySchema = Joi.object() filter: Joi.string().regex(genericFilterRegex).max(100).min(1), onlyMarketplaceProjects: Joi.boolean(), }) + .when(Joi.object({ xls: Joi.exist() }).unknown(), { + then: Joi.object({ + page: Joi.number().min(1).optional(), + limit: Joi.number().max(100).min(1).optional(), + }), + }) .with('page', 'limit') .with('limit', 'page'); diff --git a/src/validations/units.validations.js b/src/validations/units.validations.js index 07a8c2e6..99966bcf 100644 --- a/src/validations/units.validations.js +++ b/src/validations/units.validations.js @@ -53,7 +53,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(), @@ -81,6 +81,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({