Skip to content

Commit aced969

Browse files
committed
Fix bugs introduced by new dependencies
1 parent c208139 commit aced969

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

package-scripts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = {
132132
script: series(
133133
'nps banner.revert',
134134
'nps config',
135-
runFast('./node_modules/typeorm/cli.js migrations:revert')
135+
runFast('./node_modules/typeorm/cli.js migration:revert')
136136
),
137137
description: 'Downgrades the database'
138138
},

src/api/services/PetService.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export class PetService {
4949
return this.petRepository.save(pet);
5050
}
5151

52-
public delete(id: string): Promise<void> {
52+
public async delete(id: string): Promise<void> {
5353
this.log.info('Delete a pet');
54-
return this.petRepository.removeById(id);
54+
await this.petRepository.delete(id);
55+
return;
5556
}
5657

5758
}

src/api/services/UserService.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ export class UserService {
3939
return this.userRepository.save(user);
4040
}
4141

42-
public delete(id: string): Promise<void> {
42+
public async delete(id: string): Promise<void> {
4343
this.log.info('Delete a user');
44-
return this.userRepository.removeById(id);
44+
await this.userRepository.delete(id);
45+
return;
4546
}
4647

4748
}

src/auth/AuthService.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as express from 'express';
22
import * as request from 'request';
3-
import { Require, Service } from 'typedi';
3+
import { Service } from 'typedi';
44

55
import { Logger, LoggerInterface } from '../decorators/Logger';
66
import { env } from '../env';
@@ -12,10 +12,9 @@ export class AuthService {
1212
private httpRequest: typeof request;
1313

1414
constructor(
15-
@Require('request') r: any,
1615
@Logger(__filename) private log: LoggerInterface
1716
) {
18-
this.httpRequest = r;
17+
this.httpRequest = request;
1918
}
2019

2120
public parseTokenFromRequest(req: express.Request): string | undefined {

test/unit/auth/AuthService.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('AuthService', () => {
1313
let log: LogMock;
1414
beforeEach(() => {
1515
log = new LogMock();
16-
authService = new AuthService(request, log);
16+
authService = new AuthService(log);
1717
});
1818

1919
describe('parseTokenFromRequest', () => {

0 commit comments

Comments
 (0)