Skip to content

Commit bdc1a1c

Browse files
committed
Merge branch 'staging' into bugfix/schiltz3/deepsource
2 parents 70cae6a + 1f391bf commit bdc1a1c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

rolesOps.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ export async function addNewRole<T extends IRole>(
6464
) {
6565
// This function is triggered when a user changes their role, it adds the new role to the user
6666
let role;
67-
switch (model.constructor) {
68-
case classModel:
67+
switch (model.modelName) {
68+
case "class":
6969
//TODO: Rewrite IRole to include name, and replace CODE with name
7070
role = await model.findOne({ CODE: id });
71+
break;
7172
default:
72-
role = await model.findOne({ Name: id });
73+
role = await model.findOne({ NAME: id });
7374
}
7475

7576
if (role === null) {

0 commit comments

Comments
 (0)