Skip to content

Commit 9aa1166

Browse files
committed
chore: use roles constant in validation
1 parent 70a0d19 commit 9aa1166

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

middlewares/validators/user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const joi = require("joi");
22
const { USER_STATUS } = require("../../constants/users");
3+
const ROLES = require("../../constants/roles");
34

45
const updateUser = async (req, res, next) => {
56
const schema = joi
@@ -172,7 +173,7 @@ async function validateUserQueryParams(req, res, next) {
172173
joi.array().items(joi.string().valid("IDLE", "OOO", "ACTIVE"))
173174
)
174175
.optional(),
175-
role: joi.string().valid("in_discord", "member").optional(),
176+
role: joi.string().valid(ROLES.MEMBER, ROLES.INDISCORD).optional(),
176177
verified: joi.string().optional(),
177178
})
178179
.messages({

0 commit comments

Comments
 (0)