fix: .js toevoegen aan imports

This commit is contained in:
Tibo De Peuter 2025-04-24 10:53:08 +02:00
parent 6847961688
commit 04fd54e3d6
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
25 changed files with 73 additions and 75 deletions

View file

@ -1,7 +1,7 @@
import express from 'express';
import { createAnswerHandler, deleteAnswerHandler, getAnswerHandler, getAllAnswersHandler, updateAnswerHandler } from '../controllers/answers.js';
import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowAuthor, onlyAllowAuthorRequestAnswer, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks';
import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js';
import { onlyAllowAuthor, onlyAllowAuthorRequestAnswer, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks.js';
const router = express.Router({ mergeParams: true });

View file

@ -9,9 +9,9 @@ import {
putAssignmentHandler,
} from '../controllers/assignments.js';
import groupRouter from './groups.js';
import { teachersOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks';
import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks';
import { teachersOnly } from '../middleware/auth/checks/auth-checks.js';
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks.js';
import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks.js';
const router = express.Router({ mergeParams: true });

View file

@ -14,8 +14,8 @@ import {
putClassHandler,
} from '../controllers/classes.js';
import assignmentRouter from './assignments.js';
import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks';
import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js';
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks.js';
const router = express.Router();

View file

@ -8,9 +8,9 @@ import {
getGroupSubmissionsHandler,
putGroupHandler,
} from '../controllers/groups.js';
import { onlyAllowIfHasAccessToGroup } from '../middleware/auth/checks/group-auth-checker';
import { teachersOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks';
import { onlyAllowIfHasAccessToGroup } from '../middleware/auth/checks/group-auth-checker.js';
import { teachersOnly } from '../middleware/auth/checks/auth-checks.js';
import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks.js';
const router = express.Router({ mergeParams: true });

View file

@ -1,9 +1,8 @@
import express from 'express';
import { getAllLearningObjects, getAttachment, getLearningObject, getLearningObjectHTML } from '../controllers/learning-objects.js';
import submissionRoutes from './submissions.js';
import questionRoutes from './questions.js';
import { authenticatedOnly } from '../middleware/auth/checks/auth-checks';
import { authenticatedOnly } from '../middleware/auth/checks/auth-checks.js';
const router = express.Router();

View file

@ -1,6 +1,6 @@
import express from 'express';
import { getLearningPaths } from '../controllers/learning-paths.js';
import { authenticatedOnly } from '../middleware/auth/checks/auth-checks';
import { authenticatedOnly } from '../middleware/auth/checks/auth-checks.js';
const router = express.Router();

View file

@ -1,9 +1,9 @@
import express from 'express';
import { createQuestionHandler, deleteQuestionHandler, getAllQuestionsHandler, getQuestionHandler } from '../controllers/questions.js';
import answerRoutes from './answers.js';
import { adminOnly, studentsOnly } from '../middleware/auth/checks/auth-checks';
import { updateAnswerHandler } from '../controllers/answers';
import { onlyAllowAuthor, onlyAllowAuthorRequest, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks';
import { adminOnly, studentsOnly } from '../middleware/auth/checks/auth-checks.js';
import { updateAnswerHandler } from '../controllers/answers.js';
import { onlyAllowAuthor, onlyAllowAuthorRequest, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks.js';
const router = express.Router({ mergeParams: true });

View file

@ -5,8 +5,8 @@ import {
getStudentRequestHandler,
getStudentRequestsHandler,
} from '../controllers/students.js';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks';
import { onlyAllowStudentHimselfAndTeachersOfClass } from '../middleware/auth/checks/class-auth-checks';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js';
import { onlyAllowStudentHimselfAndTeachersOfClass } from '../middleware/auth/checks/class-auth-checks.js';
// Under /:username/joinRequests/

View file

@ -11,8 +11,8 @@ import {
getStudentSubmissionsHandler,
} from '../controllers/students.js';
import joinRequestRouter from './student-join-requests.js';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks';
import { adminOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js';
import { adminOnly } from '../middleware/auth/checks/auth-checks.js';
const router = express.Router();

View file

@ -5,14 +5,14 @@ import {
getAllInvitationsHandler,
getInvitationHandler,
updateInvitationHandler,
} from '../controllers/teacher-invitations';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks';
} from '../controllers/teacher-invitations.js';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js';
import {
onlyAllowReceiverBody,
onlyAllowSender,
onlyAllowSenderBody,
onlyAllowSenderOrReceiver,
} from '../middleware/auth/checks/teacher-invitation-checks';
} from '../middleware/auth/checks/teacher-invitation-checks.js';
const router = express.Router({ mergeParams: true });

View file

@ -11,10 +11,9 @@ import {
updateStudentJoinRequestHandler,
} from '../controllers/teachers.js';
import invitationRouter from './teacher-invitations.js';
import { adminOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks';
import { onlyAllowTeacherOfClass } from '../middleware/auth/checks/class-auth-checks';
import { adminOnly } from '../middleware/auth/checks/auth-checks.js';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js';
import { onlyAllowTeacherOfClass } from '../middleware/auth/checks/class-auth-checks.js';
const router = express.Router();
// Root endpoint used to search objects

View file

@ -1,6 +1,6 @@
import express from 'express';
import { getThemesHandler, getHruidsByThemeHandler } from '../controllers/themes.js';
import { authenticatedOnly } from '../middleware/auth/checks/auth-checks';
import { authenticatedOnly } from '../middleware/auth/checks/auth-checks.js';
const router = express.Router();