From 5df63a5773cbada4101e5cec400f562ff0c1f7d3 Mon Sep 17 00:00:00 2001 From: Mike Keen Date: Mon, 10 Jan 2022 17:59:35 -0500 Subject: [PATCH] feat: simplify routes --- src/routes/v1/resources/projects.js | 4 +--- src/routes/v1/resources/units.js | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/routes/v1/resources/projects.js b/src/routes/v1/resources/projects.js index f9044f16..4bc1df57 100644 --- a/src/routes/v1/resources/projects.js +++ b/src/routes/v1/resources/projects.js @@ -13,9 +13,7 @@ const querySchema = Joi.object() page: Joi.number(), limit: Joi.number(), search: Joi.string(), - columns: Joi.alternatives().try( - Joi.array().items(Joi.string()).single(), - ), + columns: Joi.array().items(Joi.string()).single(), }) .with('page', 'limit'); diff --git a/src/routes/v1/resources/units.js b/src/routes/v1/resources/units.js index 6d12eb73..9294d87b 100644 --- a/src/routes/v1/resources/units.js +++ b/src/routes/v1/resources/units.js @@ -13,9 +13,7 @@ const querySchema = Joi.object() page: Joi.number(), limit: Joi.number(), search: Joi.string(), - columns: Joi.alternatives().try( - Joi.array().items(Joi.string()).single(), - ), + columns: Joi.array().items(Joi.string()).single(), }) .with('page', 'limit');