Merge remote-tracking branch 'origin/refactor/common' into feat/user-routes-test-interface-refactor
# Conflicts: # backend/src/controllers/students.ts # backend/src/controllers/teachers.ts # backend/src/interfaces/answer.ts # backend/src/interfaces/question.ts # backend/src/interfaces/student.ts # backend/src/services/classes.ts # backend/src/services/questions.ts # backend/src/services/students.ts # backend/src/services/teachers.ts
This commit is contained in:
commit
4ca568e738
57 changed files with 270 additions and 190 deletions
|
@ -1,6 +1,7 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createAssignment, getAllAssignments, getAssignment, getAssignmentsSubmissions } from '../services/assignments.js';
|
||||
import { AssignmentDTO } from '../interfaces/assignment.js';
|
||||
|
||||
import { AssignmentDTO } from 'dwengo-1-common/src/interfaces/assignment';
|
||||
|
||||
// Typescript is annoying with parameter forwarding from class.ts
|
||||
interface AssignmentParams {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createClass, getAllClasses, getClass, getClassStudents, getClassStudentsIds, getClassTeacherInvitations } from '../services/classes.js';
|
||||
import { ClassDTO } from '../interfaces/class.js';
|
||||
|
||||
import { ClassDTO } from 'dwengo-1-common/src/interfaces/class';
|
||||
|
||||
export async function getAllClassesHandler(req: Request, res: Response): Promise<void> {
|
||||
const full = req.query.full === 'true';
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createGroup, getAllGroups, getGroup, getGroupSubmissions } from '../services/groups.js';
|
||||
import { GroupDTO } from '../interfaces/group.js';
|
||||
|
||||
import { GroupDTO } from 'dwengo-1-common/src/interfaces/group';
|
||||
|
||||
// Typescript is annoywith with parameter forwarding from class.ts
|
||||
interface GroupParams {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { FALLBACK_LANG } from '../config.js';
|
||||
import { FilteredLearningObject, LearningObjectIdentifier, LearningPathIdentifier } from '../interfaces/learning-content.js';
|
||||
import learningObjectService from '../services/learning-objects/learning-object-service.js';
|
||||
import { envVars, getEnvVar } from '../util/envVars.js';
|
||||
import { Language } from '../entities/content/language.js';
|
||||
import attachmentService from '../services/learning-objects/attachment-service.js';
|
||||
import { NotFoundError } from '@mikro-orm/core';
|
||||
import { BadRequestException } from '../exceptions/bad-request-exception.js';
|
||||
import { FilteredLearningObject, LearningObjectIdentifier, LearningPathIdentifier } from 'dwengo-1-common/src/interfaces/learning-content';
|
||||
|
||||
function getLearningObjectIdentifierFromRequest(req: Request): LearningObjectIdentifier {
|
||||
if (!req.params.hruid) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createQuestion, deleteQuestion, getAllQuestions, getAnswersByQuestion, getQuestion } from '../services/questions.js';
|
||||
import { QuestionDTO, QuestionId } from '../interfaces/question.js';
|
||||
import { FALLBACK_LANG, FALLBACK_SEQ_NUM } from '../config.js';
|
||||
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
|
||||
import { Language } from '../entities/content/language.js';
|
||||
import { QuestionDTO, QuestionId } from 'dwengo-1-common/src/interfaces/question';
|
||||
|
||||
function getObjectId(req: Request, res: Response): LearningObjectIdentifier | null {
|
||||
const { hruid, version } = req.params;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createSubmission, deleteSubmission, getSubmission } from '../services/submissions.js';
|
||||
import { Language, languageMap } from '../entities/content/language.js';
|
||||
import { SubmissionDTO } from '../interfaces/submission';
|
||||
|
||||
import { SubmissionDTO } from 'dwengo-1-common/src/interfaces/submission';
|
||||
|
||||
interface SubmissionParams {
|
||||
hruid: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue