diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 10:59:13 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-11 10:59:13 +0200 |
commit | e6d4b0ff2404dcf0b3a755c3fcc415ffeb6e754d (patch) | |
tree | c50bf2ba57d54d2f87f51c29ad981da8c5660994 /server/lib | |
parent | 33c4972d5b54155540267f4c9c9ee55c539b8385 (diff) | |
download | PeerTube-e6d4b0ff2404dcf0b3a755c3fcc415ffeb6e754d.tar.gz PeerTube-e6d4b0ff2404dcf0b3a755c3fcc415ffeb6e754d.tar.zst PeerTube-e6d4b0ff2404dcf0b3a755c3fcc415ffeb6e754d.zip |
Remove any typing from server
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/friends.ts | 10 | ||||
-rw-r--r-- | server/lib/oauth-model.ts | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/server/lib/friends.ts b/server/lib/friends.ts index 4d56e9eb2..a65820191 100644 --- a/server/lib/friends.ts +++ b/server/lib/friends.ts | |||
@@ -38,7 +38,9 @@ import { | |||
38 | RemoteVideoCreateData, | 38 | RemoteVideoCreateData, |
39 | RemoteVideoUpdateData, | 39 | RemoteVideoUpdateData, |
40 | RemoteVideoRemoveData, | 40 | RemoteVideoRemoveData, |
41 | RemoteVideoReportAbuseData | 41 | RemoteVideoReportAbuseData, |
42 | ResultList, | ||
43 | Pod as FormatedPod | ||
42 | } from '../../shared' | 44 | } from '../../shared' |
43 | 45 | ||
44 | type QaduParam = { videoId: string, type: RequestVideoQaduType } | 46 | type QaduParam = { videoId: string, type: RequestVideoQaduType } |
@@ -268,8 +270,8 @@ export { | |||
268 | 270 | ||
269 | function computeForeignPodsList (host: string, podsScore: { [ host: string ]: number }) { | 271 | function computeForeignPodsList (host: string, podsScore: { [ host: string ]: number }) { |
270 | // TODO: type res | 272 | // TODO: type res |
271 | return getForeignPodsList(host).then((res: any) => { | 273 | return getForeignPodsList(host).then(res => { |
272 | const foreignPodsList = res.data | 274 | const foreignPodsList: { host: string }[] = res.data |
273 | 275 | ||
274 | // Let's give 1 point to the pod we ask the friends list | 276 | // Let's give 1 point to the pod we ask the friends list |
275 | foreignPodsList.push({ host }) | 277 | foreignPodsList.push({ host }) |
@@ -302,7 +304,7 @@ function computeWinningPods (hosts: string[], podsScore: { [ host: string ]: num | |||
302 | } | 304 | } |
303 | 305 | ||
304 | function getForeignPodsList (host: string) { | 306 | function getForeignPodsList (host: string) { |
305 | return new Promise((res, rej) => { | 307 | return new Promise< ResultList<FormatedPod> >((res, rej) => { |
306 | const path = '/api/' + API_VERSION + '/pods' | 308 | const path = '/api/' + API_VERSION + '/pods' |
307 | 309 | ||
308 | request.get(REMOTE_SCHEME.HTTP + '://' + host + path, function (err, response, body) { | 310 | request.get(REMOTE_SCHEME.HTTP + '://' + host + path, function (err, response, body) { |
diff --git a/server/lib/oauth-model.ts b/server/lib/oauth-model.ts index f34c9c667..2d7e56756 100644 --- a/server/lib/oauth-model.ts +++ b/server/lib/oauth-model.ts | |||
@@ -68,11 +68,10 @@ function saveToken (token: TokenInfo, client: OAuthClientInstance, user: UserIns | |||
68 | userId: user.id | 68 | userId: user.id |
69 | } | 69 | } |
70 | 70 | ||
71 | return db.OAuthToken.create(tokenToCreate).then(function (tokenCreated: any) { | 71 | return db.OAuthToken.create(tokenToCreate).then(tokenCreated => { |
72 | tokenCreated.client = client | 72 | const tokenToReturn = Object.assign(tokenCreated, { client, user }) |
73 | tokenCreated.user = user | ||
74 | 73 | ||
75 | return tokenCreated | 74 | return tokenToReturn |
76 | }) | 75 | }) |
77 | } | 76 | } |
78 | 77 | ||