We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
addNewRole
1 parent eebe820 commit fd8b571Copy full SHA for fd8b571
rolesOps.ts
@@ -63,12 +63,13 @@ export async function addNewRole<T extends IRole>(
63
) {
64
// This function is triggered when a user changes their role, it adds the new role to the user
65
let role;
66
- switch (model.constructor) {
67
- case classModel:
+ switch (model.modelName) {
+ case "class":
68
//TODO: Rewrite IRole to include name, and replace CODE with name
69
role = await model.findOne({ CODE: id });
70
+ break;
71
default:
- role = await model.findOne({ Name: id });
72
+ role = await model.findOne({ NAME: id });
73
}
74
75
if (role === null) {
0 commit comments