Skip to content

Commit 8ff5d03

Browse files
vip-gitVipin
authored andcommitted
fix: services issues fixed with typings
1 parent 84ece10 commit 8ff5d03

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,29 @@
7171
"@types/async": "^2.0.49",
7272
"@types/bcrypt-nodejs": "0.0.30",
7373
"@types/body-parser": "^1.17.0",
74-
"@types/compression": "0.0.33",
75-
"@types/connect-mongo": "0.0.34",
76-
"@types/dotenv": "^2.0.20",
74+
"@types/compression": "0.0.36",
75+
"@types/connect-mongo": "0.0.35",
76+
"@types/dotenv": "^4.0.3",
7777
"@types/express": "^4.16.0",
7878
"@types/express-session": "^1.15.9",
79-
"@types/jest": "^21.1.10",
79+
"@types/jest": "^23.0.0",
8080
"@types/lodash": "^4.14.100",
81-
"@types/mongodb": "^2.2.20",
82-
"@types/mongoose": "^4.7.36",
81+
"@types/mongodb": "^3.0.19",
82+
"@types/mongoose": "^5.0.15",
8383
"@types/morgan": "^1.7.32",
84-
"@types/node": "^7.0.65",
85-
"@types/nodemailer": "^1.3.32",
84+
"@types/node": "^10.3.0",
8685
"@types/reflect-metadata": "^0.1.0",
8786
"@types/request": "^2.47.0",
8887
"@types/request-promise": "^4.1.41",
8988
"@types/supertest": "^2.0.4",
9089
"eslint": "^4.19.1",
91-
"jest": "^21.2.1",
90+
"jest": "^23.1.0",
9291
"node-sass": "^4.9.0",
9392
"nodemon": "^1.17.5",
94-
"shelljs": "^0.7.7",
95-
"supertest": "^2.0.1",
96-
"ts-jest": "^21.2.4",
97-
"ts-node": "^3.3.0",
93+
"shelljs": "^0.8.2",
94+
"supertest": "^3.1.0",
95+
"ts-jest": "^22.4.6",
96+
"ts-node": "^6.1.0",
9897
"tsconfig-paths": "^3.3.2",
9998
"tslint": "^5.10.0",
10099
"typescript": "^2.9.1"

src/common/services/shared/mongoose.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { Service } from '@tsed/common';
55

66
@Service()
77
export class MongooseService {
8-
static resource: mongoose.Connection;
8+
static resource: any;
99

10-
static async connect(): Promise<mongoose.Connection> {
10+
static async connect(): Promise<any> {
1111
const mongoUrl = process.env.MONGODB_URI;
1212

1313
if (MongooseService.resource) {

src/common/services/tvmaze/tvmaze.service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Library
22
import fetch from 'node-fetch';
3-
import * as _ from 'lodash';
3+
import { replace, chain, orderBy } from 'lodash';
44
import { Inject, Service } from '@tsed/common';
55

66
@Service()
@@ -33,11 +33,11 @@ export class TvMazeService {
3333
}).join('&');
3434
return await fetch('http://api.tvmaze.com/shows?' + queryString)
3535
.then(res => res.json())
36-
.then(json => _.chain(json)
36+
.then(json => chain(json)
3737
.map(function(values: any) {
38-
values._links.self.href = _.replace(values._links.self.href,
38+
values._links.self.href = replace(values._links.self.href,
3939
'api.tvmaze.com', 'localhost:3000/api');
40-
values._links.previousepisode.href = _.replace(values._links.previousepisode.href,
40+
values._links.previousepisode.href = replace(values._links.previousepisode.href,
4141
'api.tvmaze.com', 'localhost:3000/proxy');
4242
return values;
4343
})
@@ -53,7 +53,7 @@ export class TvMazeService {
5353
async getShowsCast(id, queryParams) {
5454
return await fetch('http://api.tvmaze.com/shows/' + id + '/cast')
5555
.then(res => res.json())
56-
.then(json => _.chain(_.orderBy(json, ['person.birthday'], ['asc']))
56+
.then(json => chain(orderBy(json, ['person.birthday'], ['asc']))
5757
.take(queryParams.limit || json.length));
5858
}
5959
}

0 commit comments

Comments
 (0)