diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-05 13:26:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-05 14:14:16 +0200 |
commit | 6fcd19ba737f1f5614a56c6925adb882dea43b8d (patch) | |
tree | 3365a96d82bc7f00ae504a568725c8e914150cf8 /server/models/request/request-to-pod.ts | |
parent | 5fe7e898316e18369c3e1aba307b55077adc7bfb (diff) | |
download | PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.gz PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.tar.zst PeerTube-6fcd19ba737f1f5614a56c6925adb882dea43b8d.zip |
Move to promises
Closes https://github.com/Chocobozzz/PeerTube/issues/74
Diffstat (limited to 'server/models/request/request-to-pod.ts')
-rw-r--r-- | server/models/request/request-to-pod.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/server/models/request/request-to-pod.ts b/server/models/request/request-to-pod.ts index 67331be1d..6678ed290 100644 --- a/server/models/request/request-to-pod.ts +++ b/server/models/request/request-to-pod.ts | |||
@@ -2,7 +2,6 @@ import * as Sequelize from 'sequelize' | |||
2 | 2 | ||
3 | import { addMethodsToModel } from '../utils' | 3 | import { addMethodsToModel } from '../utils' |
4 | import { | 4 | import { |
5 | RequestToPodClass, | ||
6 | RequestToPodInstance, | 5 | RequestToPodInstance, |
7 | RequestToPodAttributes, | 6 | RequestToPodAttributes, |
8 | 7 | ||
@@ -38,9 +37,7 @@ export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.Da | |||
38 | 37 | ||
39 | // --------------------------------------------------------------------------- | 38 | // --------------------------------------------------------------------------- |
40 | 39 | ||
41 | removeByRequestIdsAndPod = function (requestsIds: number[], podId: number, callback?: RequestToPodMethods.RemoveByRequestIdsAndPodCallback) { | 40 | removeByRequestIdsAndPod = function (requestsIds: number[], podId: number) { |
42 | if (!callback) callback = function () { /* empty */ } | ||
43 | |||
44 | const query = { | 41 | const query = { |
45 | where: { | 42 | where: { |
46 | requestId: { | 43 | requestId: { |
@@ -50,5 +47,5 @@ removeByRequestIdsAndPod = function (requestsIds: number[], podId: number, callb | |||
50 | } | 47 | } |
51 | } | 48 | } |
52 | 49 | ||
53 | RequestToPod.destroy(query).asCallback(callback) | 50 | return RequestToPod.destroy(query) |
54 | } | 51 | } |