Skip to content

Commit

Permalink
fix: allow unpaginated requests on xls download
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Apr 8, 2024
1 parent efea1d7 commit e13bf3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 6 additions & 0 deletions src/validations/units.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit e13bf3e

Please sign in to comment.