diff --git a/src/validations/projects.validations.js b/src/validations/projects.validations.js index dd6a372e..4b11ba70 100644 --- a/src/validations/projects.validations.js +++ b/src/validations/projects.validations.js @@ -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..85ab319e 100644 --- a/src/validations/units.validations.js +++ b/src/validations/units.validations.js @@ -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({