Skip to content

Commit

Permalink
fix: do not require pagination when projectIds is used as a query param
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Mar 6, 2024
1 parent dc53674 commit c9b32cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cadt",
"version": "1.7.9",
"version": "1.7.10",
"_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",
Expand Down
12 changes: 12 additions & 0 deletions src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ export const projectsGetQuerySchema = Joi.object({
}),
},
)
.when(
Joi.object({
projectIds: Joi.array().items(Joi.string()).single().min(1),
}),
{
then: Joi.object(),
otherwise: Joi.object({
page: Joi.number().required(),
limit: Joi.number().required(),
}),
},
)
.and('page', 'limit');

export const projectsPostSchema = Joi.object({
Expand Down

0 comments on commit c9b32cc

Please sign in to comment.