Add tests for inviteController
This commit is contained in:
1 parent
e052adfd91
commit
4ce08e05df
4 files changed
+209
-17
No files matched your search
@@ -10,8 +10,8 @@ const { start } = require("repl");
|
||||
const roleValidatior = (role) => (value, helpers) => {
|
||||
const hasRole = role.some((role) => value.includes(role));
|
||||
if (!hasRole) {
|
||||
throw new Joi.ValidationError(
|
||||
`You do not have the required authorization. Required roles: ${roles.join(", ")}`
|
||||
throw new joi.ValidationError(
|
||||
`You do not have the required authorization. Required roles: ${role.join(", ")}`
|
||||
);
|
||||
}
|
||||
return value;
|
||||
|
||||
Reference in new issue
Block a user