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.
2 parents 70cae6a + 1f391bf commit bdc1a1cCopy full SHA for bdc1a1c
rolesOps.ts
@@ -64,12 +64,13 @@ export async function addNewRole<T extends IRole>(
64
) {
65
// This function is triggered when a user changes their role, it adds the new role to the user
66
let role;
67
- switch (model.constructor) {
68
- case classModel:
+ switch (model.modelName) {
+ case "class":
69
//TODO: Rewrite IRole to include name, and replace CODE with name
70
role = await model.findOne({ CODE: id });
71
+ break;
72
default:
- role = await model.findOne({ Name: id });
73
+ role = await model.findOne({ NAME: id });
74
}
75
76
if (role === null) {
0 commit comments