fix(backend): Bugs omtrent leerpad-endpoints opgelost
This commit is contained in:
parent
6929288554
commit
1a768fedcc
6 changed files with 12 additions and 12 deletions
|
@ -3,10 +3,10 @@ import { authorize } from "../auth";
|
|||
import { AuthenticatedRequest } from "../authenticated-request";
|
||||
import { AuthenticationInfo } from "../authentication-info";
|
||||
|
||||
export const onlyAdminsForLearningPath = authorize((auth: AuthenticationInfo, req: AuthenticatedRequest) => {
|
||||
const adminsForLearningPath = learningPathService.getAdmins({
|
||||
export const onlyAdminsForLearningPath = authorize(async (auth: AuthenticationInfo, req: AuthenticatedRequest) => {
|
||||
const adminsForLearningPath = await learningPathService.getAdmins({
|
||||
hruid: req.body.hruid,
|
||||
language: req.body.language
|
||||
});
|
||||
return adminsForLearningPath && auth.username in adminsForLearningPath;
|
||||
return adminsForLearningPath && adminsForLearningPath.includes(auth.username);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue