fix: .js toevoegen aan imports
This commit is contained in:
		
							parent
							
								
									6847961688
								
							
						
					
					
						commit
						04fd54e3d6
					
				
					 25 changed files with 73 additions and 75 deletions
				
			
		|  | @ -2,10 +2,10 @@ import { UnauthorizedException } from '../exceptions/unauthorized-exception.js'; | ||||||
| import { getLogger } from '../logging/initalize.js'; | import { getLogger } from '../logging/initalize.js'; | ||||||
| import { AuthenticatedRequest } from '../middleware/auth/authenticated-request.js'; | import { AuthenticatedRequest } from '../middleware/auth/authenticated-request.js'; | ||||||
| import { envVars, getEnvVar } from '../util/envVars.js'; | import { envVars, getEnvVar } from '../util/envVars.js'; | ||||||
| import { createOrUpdateStudent, createStudent } from '../services/students'; | import { createOrUpdateStudent, createStudent } from '../services/students.js'; | ||||||
| import { AuthenticationInfo } from '../middleware/auth/authentication-info'; | import { AuthenticationInfo } from '../middleware/auth/authentication-info.js'; | ||||||
| import { Request, Response } from 'express'; | import { Request, Response } from 'express'; | ||||||
| import { createOrUpdateTeacher, createTeacher } from '../services/teachers'; | import { createOrUpdateTeacher, createTeacher } from '../services/teachers.js'; | ||||||
| 
 | 
 | ||||||
| interface FrontendIdpConfig { | interface FrontendIdpConfig { | ||||||
|     authority: string; |     authority: string; | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ import { Request, Response } from 'express'; | ||||||
| import { requireFields } from './error-helper.js'; | import { requireFields } from './error-helper.js'; | ||||||
| import { createInvitation, deleteInvitation, getAllInvitations, getInvitation, updateInvitation } from '../services/teacher-invitations.js'; | import { createInvitation, deleteInvitation, getAllInvitations, getInvitation, updateInvitation } from '../services/teacher-invitations.js'; | ||||||
| import { TeacherInvitationData } from '@dwengo-1/common/interfaces/teacher-invitation'; | import { TeacherInvitationData } from '@dwengo-1/common/interfaces/teacher-invitation'; | ||||||
| import { ConflictException } from '../exceptions/conflict-exception'; | import { ConflictException } from '../exceptions/conflict-exception.js'; | ||||||
| 
 | 
 | ||||||
| export async function getAllInvitationsHandler(req: Request, res: Response): Promise<void> { | export async function getAllInvitationsHandler(req: Request, res: Response): Promise<void> { | ||||||
|     const username = req.params.username; |     const username = req.params.username; | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| import { authorize } from './auth-checks'; | import { authorize } from './auth-checks.js'; | ||||||
| import { fetchClass } from '../../../services/classes'; | import { fetchClass } from '../../../services/classes.js'; | ||||||
| import { fetchAllGroups } from '../../../services/groups'; | import { fetchAllGroups } from '../../../services/groups.js'; | ||||||
| import { mapToUsername } from '../../../interfaces/user'; | import { mapToUsername } from '../../../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Expects the path to contain the path parameters 'classId' and 'id' (meaning the ID of the assignment). |  * Expects the path to contain the path parameters 'classId' and 'id' (meaning the ID of the assignment). | ||||||
|  |  | ||||||
|  | @ -1,9 +1,9 @@ | ||||||
| import { AuthenticationInfo } from '../authentication-info'; | import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
| import { AuthenticatedRequest } from '../authenticated-request'; | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
| import * as express from 'express'; | import * as express from 'express'; | ||||||
| import { UnauthorizedException } from '../../../exceptions/unauthorized-exception'; |  | ||||||
| import { ForbiddenException } from '../../../exceptions/forbidden-exception'; |  | ||||||
| import { RequestHandler } from 'express'; | import { RequestHandler } from 'express'; | ||||||
|  | import { UnauthorizedException } from '../../../exceptions/unauthorized-exception.js'; | ||||||
|  | import { ForbiddenException } from '../../../exceptions/forbidden-exception.js'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Middleware which rejects unauthenticated users (with HTTP 401) and authenticated users which do not fulfill |  * Middleware which rejects unauthenticated users (with HTTP 401) and authenticated users which do not fulfill | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| import { authorize } from './auth-checks'; | import { authorize } from './auth-checks.js'; | ||||||
| import { AuthenticationInfo } from '../authentication-info'; | import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
| import { AuthenticatedRequest } from '../authenticated-request'; | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
| import { fetchClass } from '../../../services/classes'; | import { fetchClass } from '../../../services/classes.js'; | ||||||
| import { mapToUsername } from '../../../interfaces/user'; | import { mapToUsername } from '../../../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| async function teaches(teacherUsername: string, classId: string): Promise<boolean> { | async function teaches(teacherUsername: string, classId: string): Promise<boolean> { | ||||||
|     const clazz = await fetchClass(classId); |     const clazz = await fetchClass(classId); | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| import { authorize } from './auth-checks'; | import { authorize } from './auth-checks.js'; | ||||||
| import { fetchClass } from '../../../services/classes'; | import { fetchClass } from '../../../services/classes.js'; | ||||||
| import { fetchGroup } from '../../../services/groups'; | import { fetchGroup } from '../../../services/groups.js'; | ||||||
| import { mapToUsername } from '../../../interfaces/user'; | import { mapToUsername } from '../../../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Expects the path to contain the path parameters 'classid', 'assignmentid' and 'groupid'. |  * Expects the path to contain the path parameters 'classid', 'assignmentid' and 'groupid'. | ||||||
|  |  | ||||||
|  | @ -1,12 +1,12 @@ | ||||||
| import { authorize } from './auth-checks'; | import { authorize } from './auth-checks.js'; | ||||||
| import { AuthenticationInfo } from '../authentication-info'; | import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
| import { AuthenticatedRequest } from '../authenticated-request'; | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
| import { requireFields } from '../../../controllers/error-helper'; | import { requireFields } from '../../../controllers/error-helper.js'; | ||||||
| import { getLearningObjectId, getQuestionId } from '../../../controllers/questions'; | import { getLearningObjectId, getQuestionId } from '../../../controllers/questions.js'; | ||||||
| import { fetchQuestion } from '../../../services/questions'; | import { fetchQuestion } from '../../../services/questions.js'; | ||||||
| import { FALLBACK_SEQ_NUM } from '../../../config'; | import { FALLBACK_SEQ_NUM } from '../../../config.js'; | ||||||
| import { fetchAnswer } from '../../../services/answers'; | import { fetchAnswer } from '../../../services/answers.js'; | ||||||
| import { mapToUsername } from '../../../interfaces/user'; | import { mapToUsername } from '../../../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| export const onlyAllowAuthor = authorize( | export const onlyAllowAuthor = authorize( | ||||||
|     (auth: AuthenticationInfo, req: AuthenticatedRequest) => (req.body as { author: string }).author === auth.username |     (auth: AuthenticationInfo, req: AuthenticatedRequest) => (req.body as { author: string }).author === auth.username | ||||||
|  |  | ||||||
|  | @ -1,11 +1,11 @@ | ||||||
| import { LearningObjectIdentifier } from '../../../entities/content/learning-object-identifier'; |  | ||||||
| import { fetchSubmission } from '../../../services/submissions'; |  | ||||||
| import { AuthenticatedRequest } from '../authenticated-request'; |  | ||||||
| import { AuthenticationInfo } from '../authentication-info'; |  | ||||||
| import { authorize } from './auth-checks'; |  | ||||||
| import { FALLBACK_LANG } from '../../../config'; |  | ||||||
| import { mapToUsername } from '../../../interfaces/user'; |  | ||||||
| import { languageMap } from '@dwengo-1/common/util/language'; | import { languageMap } from '@dwengo-1/common/util/language'; | ||||||
|  | import { LearningObjectIdentifier } from '../../../entities/content/learning-object-identifier.js'; | ||||||
|  | import { fetchSubmission } from '../../../services/submissions.js'; | ||||||
|  | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
|  | import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
|  | import { authorize } from './auth-checks.js'; | ||||||
|  | import { FALLBACK_LANG } from '../../../config.js'; | ||||||
|  | import { mapToUsername } from '../../../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| export const onlyAllowSubmitter = authorize( | export const onlyAllowSubmitter = authorize( | ||||||
|     (auth: AuthenticationInfo, req: AuthenticatedRequest) => (req.body as { submitter: string }).submitter === auth.username |     (auth: AuthenticationInfo, req: AuthenticatedRequest) => (req.body as { submitter: string }).submitter === auth.username | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import { authorize } from './auth-checks'; | import { authorize } from './auth-checks.js'; | ||||||
| import { AuthenticationInfo } from '../authentication-info'; | import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
| import { AuthenticatedRequest } from '../authenticated-request'; | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
| 
 | 
 | ||||||
| export const onlyAllowSenderOrReceiver = authorize( | export const onlyAllowSenderOrReceiver = authorize( | ||||||
|     (auth: AuthenticationInfo, req: AuthenticatedRequest) => req.params.sender === auth.username || req.params.receiver === auth.username |     (auth: AuthenticationInfo, req: AuthenticatedRequest) => req.params.sender === auth.username || req.params.receiver === auth.username | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import { authorize } from './auth-checks'; | import { authorize } from './auth-checks.js'; | ||||||
| import { AuthenticationInfo } from '../authentication-info'; | import { AuthenticationInfo } from '../authentication-info.js'; | ||||||
| import { AuthenticatedRequest } from '../authenticated-request'; | import { AuthenticatedRequest } from '../authenticated-request.js'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Only allow the user whose username is in the path parameter "username" to access the endpoint. |  * Only allow the user whose username is in the path parameter "username" to access the endpoint. | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| import express from 'express'; | import express from 'express'; | ||||||
| import { createAnswerHandler, deleteAnswerHandler, getAnswerHandler, getAllAnswersHandler, updateAnswerHandler } from '../controllers/answers.js'; | import { createAnswerHandler, deleteAnswerHandler, getAnswerHandler, getAllAnswersHandler, updateAnswerHandler } from '../controllers/answers.js'; | ||||||
| import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks'; | import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import { onlyAllowAuthor, onlyAllowAuthorRequestAnswer, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks'; | import { onlyAllowAuthor, onlyAllowAuthorRequestAnswer, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router({ mergeParams: true }); | const router = express.Router({ mergeParams: true }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -9,9 +9,9 @@ import { | ||||||
|     putAssignmentHandler, |     putAssignmentHandler, | ||||||
| } from '../controllers/assignments.js'; | } from '../controllers/assignments.js'; | ||||||
| import groupRouter from './groups.js'; | import groupRouter from './groups.js'; | ||||||
| import { teachersOnly } from '../middleware/auth/checks/auth-checks'; | import { teachersOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks'; | import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks.js'; | ||||||
| import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks'; | import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router({ mergeParams: true }); | const router = express.Router({ mergeParams: true }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -14,8 +14,8 @@ import { | ||||||
|     putClassHandler, |     putClassHandler, | ||||||
| } from '../controllers/classes.js'; | } from '../controllers/classes.js'; | ||||||
| import assignmentRouter from './assignments.js'; | import assignmentRouter from './assignments.js'; | ||||||
| import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks'; | import { adminOnly, teachersOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks'; | import { onlyAllowIfInClass } from '../middleware/auth/checks/class-auth-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -8,9 +8,9 @@ import { | ||||||
|     getGroupSubmissionsHandler, |     getGroupSubmissionsHandler, | ||||||
|     putGroupHandler, |     putGroupHandler, | ||||||
| } from '../controllers/groups.js'; | } from '../controllers/groups.js'; | ||||||
| import { onlyAllowIfHasAccessToGroup } from '../middleware/auth/checks/group-auth-checker'; | import { onlyAllowIfHasAccessToGroup } from '../middleware/auth/checks/group-auth-checker.js'; | ||||||
| import { teachersOnly } from '../middleware/auth/checks/auth-checks'; | import { teachersOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks'; | import { onlyAllowIfHasAccessToAssignment } from '../middleware/auth/checks/assignment-auth-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router({ mergeParams: true }); | const router = express.Router({ mergeParams: true }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,9 +1,8 @@ | ||||||
| import express from 'express'; | import express from 'express'; | ||||||
| import { getAllLearningObjects, getAttachment, getLearningObject, getLearningObjectHTML } from '../controllers/learning-objects.js'; | import { getAllLearningObjects, getAttachment, getLearningObject, getLearningObjectHTML } from '../controllers/learning-objects.js'; | ||||||
| 
 |  | ||||||
| import submissionRoutes from './submissions.js'; | import submissionRoutes from './submissions.js'; | ||||||
| import questionRoutes from './questions.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(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import express from 'express'; | import express from 'express'; | ||||||
| import { getLearningPaths } from '../controllers/learning-paths.js'; | 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(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,9 +1,9 @@ | ||||||
| import express from 'express'; | import express from 'express'; | ||||||
| import { createQuestionHandler, deleteQuestionHandler, getAllQuestionsHandler, getQuestionHandler } from '../controllers/questions.js'; | import { createQuestionHandler, deleteQuestionHandler, getAllQuestionsHandler, getQuestionHandler } from '../controllers/questions.js'; | ||||||
| import answerRoutes from './answers.js'; | import answerRoutes from './answers.js'; | ||||||
| import { adminOnly, studentsOnly } from '../middleware/auth/checks/auth-checks'; | import { adminOnly, studentsOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import { updateAnswerHandler } from '../controllers/answers'; | import { updateAnswerHandler } from '../controllers/answers.js'; | ||||||
| import { onlyAllowAuthor, onlyAllowAuthorRequest, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks'; | import { onlyAllowAuthor, onlyAllowAuthorRequest, onlyAllowIfHasAccessToQuestion } from '../middleware/auth/checks/question-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router({ mergeParams: true }); | const router = express.Router({ mergeParams: true }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -5,8 +5,8 @@ import { | ||||||
|     getStudentRequestHandler, |     getStudentRequestHandler, | ||||||
|     getStudentRequestsHandler, |     getStudentRequestsHandler, | ||||||
| } from '../controllers/students.js'; | } from '../controllers/students.js'; | ||||||
| import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks'; | import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js'; | ||||||
| import { onlyAllowStudentHimselfAndTeachersOfClass } from '../middleware/auth/checks/class-auth-checks'; | import { onlyAllowStudentHimselfAndTeachersOfClass } from '../middleware/auth/checks/class-auth-checks.js'; | ||||||
| 
 | 
 | ||||||
| // Under /:username/joinRequests/
 | // Under /:username/joinRequests/
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,8 +11,8 @@ import { | ||||||
|     getStudentSubmissionsHandler, |     getStudentSubmissionsHandler, | ||||||
| } from '../controllers/students.js'; | } from '../controllers/students.js'; | ||||||
| import joinRequestRouter from './student-join-requests.js'; | import joinRequestRouter from './student-join-requests.js'; | ||||||
| import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks'; | import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js'; | ||||||
| import { adminOnly } from '../middleware/auth/checks/auth-checks'; | import { adminOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -5,14 +5,14 @@ import { | ||||||
|     getAllInvitationsHandler, |     getAllInvitationsHandler, | ||||||
|     getInvitationHandler, |     getInvitationHandler, | ||||||
|     updateInvitationHandler, |     updateInvitationHandler, | ||||||
| } from '../controllers/teacher-invitations'; | } from '../controllers/teacher-invitations.js'; | ||||||
| import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks'; | import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js'; | ||||||
| import { | import { | ||||||
|     onlyAllowReceiverBody, |     onlyAllowReceiverBody, | ||||||
|     onlyAllowSender, |     onlyAllowSender, | ||||||
|     onlyAllowSenderBody, |     onlyAllowSenderBody, | ||||||
|     onlyAllowSenderOrReceiver, |     onlyAllowSenderOrReceiver, | ||||||
| } from '../middleware/auth/checks/teacher-invitation-checks'; | } from '../middleware/auth/checks/teacher-invitation-checks.js'; | ||||||
| 
 | 
 | ||||||
| const router = express.Router({ mergeParams: true }); | const router = express.Router({ mergeParams: true }); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -11,10 +11,9 @@ import { | ||||||
|     updateStudentJoinRequestHandler, |     updateStudentJoinRequestHandler, | ||||||
| } from '../controllers/teachers.js'; | } from '../controllers/teachers.js'; | ||||||
| import invitationRouter from './teacher-invitations.js'; | import invitationRouter from './teacher-invitations.js'; | ||||||
| 
 | import { adminOnly } from '../middleware/auth/checks/auth-checks.js'; | ||||||
| import { adminOnly } from '../middleware/auth/checks/auth-checks'; | import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks.js'; | ||||||
| import { onlyAllowUserHimself } from '../middleware/auth/checks/user-auth-checks'; | import { onlyAllowTeacherOfClass } from '../middleware/auth/checks/class-auth-checks.js'; | ||||||
| import { onlyAllowTeacherOfClass } from '../middleware/auth/checks/class-auth-checks'; |  | ||||||
| const router = express.Router(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
| // Root endpoint used to search objects
 | // Root endpoint used to search objects
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import express from 'express'; | import express from 'express'; | ||||||
| import { getThemesHandler, getHruidsByThemeHandler } from '../controllers/themes.js'; | 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(); | const router = express.Router(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,7 +12,7 @@ import { AssignmentDTO } from '@dwengo-1/common/interfaces/assignment'; | ||||||
| import { fetchStudent } from './students.js'; | import { fetchStudent } from './students.js'; | ||||||
| import { NotFoundException } from '../exceptions/not-found-exception.js'; | import { NotFoundException } from '../exceptions/not-found-exception.js'; | ||||||
| import { FALLBACK_VERSION_NUM } from '../config.js'; | import { FALLBACK_VERSION_NUM } from '../config.js'; | ||||||
| import { ConflictException } from '../exceptions/conflict-exception'; | import { ConflictException } from '../exceptions/conflict-exception.js'; | ||||||
| 
 | 
 | ||||||
| export async function getQuestionsAboutLearningObjectInAssignment( | export async function getQuestionsAboutLearningObjectInAssignment( | ||||||
|     loId: LearningObjectIdentifier, |     loId: LearningObjectIdentifier, | ||||||
|  |  | ||||||
|  | @ -24,8 +24,8 @@ import { SubmissionDTO, SubmissionDTOId } from '@dwengo-1/common/interfaces/subm | ||||||
| import { QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; | import { QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; | ||||||
| import { ClassJoinRequestDTO } from '@dwengo-1/common/interfaces/class-join-request'; | import { ClassJoinRequestDTO } from '@dwengo-1/common/interfaces/class-join-request'; | ||||||
| import { ConflictException } from '../exceptions/conflict-exception.js'; | import { ConflictException } from '../exceptions/conflict-exception.js'; | ||||||
| import { Submission } from '../entities/assignments/submission.entity'; | import { Submission } from '../entities/assignments/submission.entity.js'; | ||||||
| import { mapToUsername } from '../interfaces/user'; | import { mapToUsername } from '../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| export async function getAllStudents(full: boolean): Promise<StudentDTO[] | string[]> { | export async function getAllStudents(full: boolean): Promise<StudentDTO[] | string[]> { | ||||||
|     const studentRepository = getStudentRepository(); |     const studentRepository = getStudentRepository(); | ||||||
|  |  | ||||||
|  | @ -30,7 +30,7 @@ import { QuestionDTO, QuestionId } from '@dwengo-1/common/interfaces/question'; | ||||||
| import { ClassJoinRequestDTO } from '@dwengo-1/common/interfaces/class-join-request'; | import { ClassJoinRequestDTO } from '@dwengo-1/common/interfaces/class-join-request'; | ||||||
| import { ClassStatus } from '@dwengo-1/common/util/class-join-request'; | import { ClassStatus } from '@dwengo-1/common/util/class-join-request'; | ||||||
| import { ConflictException } from '../exceptions/conflict-exception.js'; | import { ConflictException } from '../exceptions/conflict-exception.js'; | ||||||
| import { mapToUsername } from '../interfaces/user'; | import { mapToUsername } from '../interfaces/user.js'; | ||||||
| 
 | 
 | ||||||
| export async function getAllTeachers(full: boolean): Promise<TeacherDTO[] | string[]> { | export async function getAllTeachers(full: boolean): Promise<TeacherDTO[] | string[]> { | ||||||
|     const teacherRepository: TeacherRepository = getTeacherRepository(); |     const teacherRepository: TeacherRepository = getTeacherRepository(); | ||||||
|  |  | ||||||
		Reference in a new issue