merge: merged into feat/error-flow-backend
This commit is contained in:
commit
effaeb0277
249 changed files with 6832 additions and 3679 deletions
|
@ -1,10 +1,10 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { createSubmission, deleteSubmission, getAllSubmissions, getSubmission } from '../services/submissions.js';
|
||||
import { Language, languageMap } from '../entities/content/language.js';
|
||||
import { SubmissionDTO } from '../interfaces/submission';
|
||||
import { BadRequestException } from '../exceptions/bad-request-exception.js';
|
||||
import { NotFoundException } from '../exceptions/not-found-exception.js';
|
||||
import { LearningObjectIdentifier } from '../entities/content/learning-object-identifier.js';
|
||||
import { Language, languageMap } from '@dwengo-1/common/util/language';
|
||||
import { SubmissionDTO } from '@dwengo-1/common/interfaces/submission';
|
||||
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ export async function getAllSubmissionsHandler(req: Request, res: Response): Pro
|
|||
res.json({ submissions });
|
||||
}
|
||||
|
||||
export async function createSubmissionHandler(req: Request, res: Response) {
|
||||
export async function createSubmissionHandler(req: Request, res: Response): Promise<void> {
|
||||
const submissionDTO = req.body as SubmissionDTO;
|
||||
|
||||
const submission = await createSubmission(submissionDTO);
|
||||
|
@ -51,10 +51,10 @@ export async function createSubmissionHandler(req: Request, res: Response) {
|
|||
res.json({ submission });
|
||||
}
|
||||
|
||||
export async function deleteSubmissionHandler(req: Request, res: Response) {
|
||||
const submissionNumber = +req.params.id;
|
||||
|
||||
export async function deleteSubmissionHandler(req: Request, res: Response): Promise<void> {
|
||||
const hruid = req.params.hruid;
|
||||
const submissionNumber = Number(req.params.id);
|
||||
|
||||
const lang = languageMap[req.query.language as string] || Language.Dutch;
|
||||
const version = (req.query.version || 1) as number;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue