We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3c121c commit a3fbd40Copy full SHA for a3fbd40
1 file changed
src/service/db/user/warning.ts
@@ -5,9 +5,8 @@ import { Warning } from "../../../entities/Warning";
5
export class WarningServiceDb extends DatabaseService {
6
private warningRepo = this.getRepo(Warning);
7
8
- async create(warning: Partial<Warning>): Promise<Warning> {
9
- const newWarning = this.warningRepo.create(warning);
10
- return this.warningRepo.save(newWarning);
+ create(warning: Partial<Warning>): Warning {
+ return this.warningRepo.create(warning);
11
}
12
13
async save(warning: Warning) {
@@ -27,6 +26,6 @@ export class WarningServiceDb extends DatabaseService {
27
26
28
29
async count(user: User) {
30
- return await this.warningRepo.count({ where: { user } });
+ return await this.warningRepo.count({ where: { user: { id: user.id } } });
31
32
0 commit comments