fix: lint
This commit is contained in:
parent
42526900d3
commit
c07db3d999
6 changed files with 18 additions and 16 deletions
|
@ -2,6 +2,7 @@ import { DwengoEntityRepository } from '../dwengo-entity-repository.js';
|
|||
import { Answer } from '../../entities/questions/answer.entity.js';
|
||||
import { Question } from '../../entities/questions/question.entity.js';
|
||||
import { Teacher } from '../../entities/users/teacher.entity.js';
|
||||
import {Loaded} from "@mikro-orm/core";
|
||||
|
||||
export class AnswerRepository extends DwengoEntityRepository<Answer> {
|
||||
public async createAnswer(answer: { toQuestion: Question; author: Teacher; content: string }): Promise<Answer> {
|
||||
|
@ -19,7 +20,7 @@ export class AnswerRepository extends DwengoEntityRepository<Answer> {
|
|||
orderBy: { sequenceNumber: 'ASC' },
|
||||
});
|
||||
}
|
||||
public async findAnswer(question: Question, sequenceNumber: number) {
|
||||
public async findAnswer(question: Question, sequenceNumber: number): Promise<Loaded<Answer, never, "*", never> | null> {
|
||||
return this.findOne({
|
||||
toQuestion: question, sequenceNumber
|
||||
});
|
||||
|
@ -30,7 +31,7 @@ export class AnswerRepository extends DwengoEntityRepository<Answer> {
|
|||
sequenceNumber: sequenceNumber,
|
||||
});
|
||||
}
|
||||
public async updateContent(answer: Answer, newContent: string){
|
||||
public async updateContent(answer: Answer, newContent: string): Promise<Answer> {
|
||||
answer.content = newContent;
|
||||
await this.save(answer);
|
||||
return answer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue