fix: Problemen met PUT op leerpaden en verschillende kleinere problemen
This commit is contained in:
parent
2db5d77296
commit
96821c40ab
21 changed files with 205 additions and 103 deletions
|
@ -1,3 +1,4 @@
|
|||
import { Language } from "@dwengo-1/common/util/language";
|
||||
import learningPathService from "../../../services/learning-paths/learning-path-service";
|
||||
import { authorize } from "../auth";
|
||||
import { AuthenticatedRequest } from "../authenticated-request";
|
||||
|
@ -5,8 +6,8 @@ import { AuthenticationInfo } from "../authentication-info";
|
|||
|
||||
export const onlyAdminsForLearningPath = authorize(async (auth: AuthenticationInfo, req: AuthenticatedRequest) => {
|
||||
const adminsForLearningPath = await learningPathService.getAdmins({
|
||||
hruid: req.body.hruid,
|
||||
language: req.body.language
|
||||
hruid: req.params.hruid,
|
||||
language: req.params.language as Language
|
||||
});
|
||||
return adminsForLearningPath && adminsForLearningPath.includes(auth.username);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue