Skip to content

Commit

Permalink
fix: refactor validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Mar 6, 2024
1 parent b023d65 commit 4c742af
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,12 @@ export const projectsGetQuerySchema = Joi.object({
onlyMarketplaceProjects: Joi.boolean(),
})
.when(
Joi.object({
warehouseProjectId: Joi.string().min(1),
}).or('warehouseProjectId'),
{
then: Joi.object(),
otherwise: Joi.object({
page: Joi.number().required(),
limit: Joi.number().required(),
Joi.alternatives().try(
Joi.object({ warehouseProjectId: Joi.string().min(1) }),
Joi.object({
projectIds: Joi.array().items(Joi.string()).single().min(1),
}),
},
)
.when(
Joi.object({
projectIds: Joi.array().items(Joi.string()).single().min(1),
}),
),
{
then: Joi.object(),
otherwise: Joi.object({
Expand Down

0 comments on commit 4c742af

Please sign in to comment.