File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,10 @@ export async function updateRoleHandler(req: Request, res: Response) {
15
15
} ) ;
16
16
}
17
17
18
- const loadedProfile = await em . findOneOrFail ( Profile , {
19
- uid : body . uid ,
20
- } ) ;
21
-
22
- loadedProfile . role = body . role ;
18
+ const loadedProfiles = await em . find ( Profile , { uid : { $in : body . uids } } ) ;
19
+ for ( const profile of loadedProfiles ) {
20
+ profile . role = body . role ;
21
+ }
23
22
24
23
await em . flush ( ) ;
25
24
@@ -28,7 +27,7 @@ export async function updateRoleHandler(req: Request, res: Response) {
28
27
message : "Role updated successfully" ,
29
28
type : StatusMessageType . SUCCESS ,
30
29
} ,
31
- payload : loadedProfile ,
30
+ payload : loadedProfiles ,
32
31
} ;
33
32
res . status ( 200 ) . send ( response ) ;
34
33
} catch ( err : any ) {
You can’t perform that action at this time.
0 commit comments