style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-04-22 16:04:52 +00:00
parent 7f670030a7
commit 0c47546814
30 changed files with 233 additions and 262 deletions

View file

@ -1,12 +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';
import { onlyAllowAuthor, onlyAllowAuthorRequestAnswer, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks';
const router = express.Router({ mergeParams: true });

View file

@ -8,9 +8,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';
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks';
import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks';
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';
import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks';
const router = express.Router();

View file

@ -7,9 +7,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';
import { teachersOnly } from '../middleware/auth/checks/auth-checks';
import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks';
const router = express.Router({ mergeParams: true });

View file

@ -3,7 +3,7 @@ import { getAllLearningObjects, getAttachment, getLearningObject, getLearningObj
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';
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';
const router = express.Router();

View file

@ -1,13 +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';
import { updateAnswerHandler } from '../controllers/answers';
import { onlyAllowAuthor, onlyAllowAuthorRequest, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks';
const router = express.Router({ mergeParams: true });
@ -23,7 +19,7 @@ router.get('/:seq', onlyAllowIfHasAccessToQuestion, getQuestionHandler);
router.delete('/:seq', studentsOnly, onlyAllowAuthorRequest, deleteQuestionHandler);
router.put("/:seq", studentsOnly, onlyAllowAuthorRequest, updateAnswerHandler);
router.put('/:seq', studentsOnly, onlyAllowAuthorRequest, updateAnswerHandler);
router.use('/:seq/answers', answerRoutes);

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';
import { onlyAllowStudentHimselfAndTeachersOfClass } from '../middleware/auth/checks/class-auth-checks';
// 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';
import { adminOnly } from '../middleware/auth/checks/auth-checks';
const router = express.Router();

View file

@ -6,18 +6,19 @@ import {
getInvitationHandler,
updateInvitationHandler,
} from '../controllers/teacher-invitations';
import {onlyAllowUserHimself} from "../middleware/auth/checks/user-auth-checks";
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks';
import {
onlyAllowReceiverBody, onlyAllowSender,
onlyAllowReceiverBody,
onlyAllowSender,
onlyAllowSenderBody,
onlyAllowSenderOrReceiver
} from "../middleware/auth/checks/teacher-invitation-checks";
onlyAllowSenderOrReceiver,
} from '../middleware/auth/checks/teacher-invitation-checks';
const router = express.Router({ mergeParams: true });
router.get('/:username', onlyAllowUserHimself, getAllInvitationsHandler);
router.get('/:sender/:receiver/:classId', onlyAllowSenderOrReceiver ,getInvitationHandler);
router.get('/:sender/:receiver/:classId', onlyAllowSenderOrReceiver, getInvitationHandler);
router.post('/', onlyAllowSenderBody, createInvitationHandler);

View file

@ -12,9 +12,9 @@ import {
} 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';
import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks';
import { onlyAllowTeacherOfClass } from '../middleware/auth/checks/class-auth-checks';
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';
const router = express.Router();