fix(backend): Formatting + .env.development.example
npm run format uitgevoerd, .env.development.example toegevoegd.
This commit is contained in:
parent
4e883a1a18
commit
48c8ce7c57
36 changed files with 499 additions and 331 deletions
|
@ -1,10 +1,14 @@
|
|||
import {DwengoEntityRepository} from "../dwengo-entity-repository";
|
||||
import {Answer} from "../../entities/questions/answer.entity";
|
||||
import {Question} from "../../entities/questions/question.entity";
|
||||
import {Teacher} from "../../entities/users/teacher.entity";
|
||||
import { DwengoEntityRepository } from '../dwengo-entity-repository';
|
||||
import { Answer } from '../../entities/questions/answer.entity';
|
||||
import { Question } from '../../entities/questions/question.entity';
|
||||
import { Teacher } from '../../entities/users/teacher.entity';
|
||||
|
||||
export class AnswerRepository extends DwengoEntityRepository<Answer> {
|
||||
public createAnswer(answer: {toQuestion: Question, author: Teacher, content: string}): Promise<Answer> {
|
||||
public createAnswer(answer: {
|
||||
toQuestion: Question;
|
||||
author: Teacher;
|
||||
content: string;
|
||||
}): Promise<Answer> {
|
||||
let answerEntity = new Answer();
|
||||
answerEntity.toQuestion = answer.toQuestion;
|
||||
answerEntity.author = answer.author;
|
||||
|
@ -14,13 +18,16 @@ export class AnswerRepository extends DwengoEntityRepository<Answer> {
|
|||
public findAllAnswersToQuestion(question: Question): Promise<Answer[]> {
|
||||
return this.findAll({
|
||||
where: { toQuestion: question },
|
||||
orderBy: { sequenceNumber: "ASC" }
|
||||
orderBy: { sequenceNumber: 'ASC' },
|
||||
});
|
||||
}
|
||||
public removeAnswerByQuestionAndSequenceNumber(question: Question, sequenceNumber: number): Promise<void> {
|
||||
public removeAnswerByQuestionAndSequenceNumber(
|
||||
question: Question,
|
||||
sequenceNumber: number
|
||||
): Promise<void> {
|
||||
return this.deleteWhere({
|
||||
toQuestion: question,
|
||||
sequenceNumber: sequenceNumber
|
||||
sequenceNumber: sequenceNumber,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue