diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-15 22:22:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-20 09:57:40 +0200 |
commit | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch) | |
tree | 4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/models/request-to-pod.js | |
parent | d5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff) | |
download | PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.gz PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.zst PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.zip |
First typescript iteration
Diffstat (limited to 'server/models/request-to-pod.js')
-rw-r--r-- | server/models/request-to-pod.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/server/models/request-to-pod.js b/server/models/request-to-pod.js deleted file mode 100644 index 0e01a842e..000000000 --- a/server/models/request-to-pod.js +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | // --------------------------------------------------------------------------- | ||
4 | |||
5 | module.exports = function (sequelize, DataTypes) { | ||
6 | const RequestToPod = sequelize.define('RequestToPod', {}, { | ||
7 | indexes: [ | ||
8 | { | ||
9 | fields: [ 'requestId' ] | ||
10 | }, | ||
11 | { | ||
12 | fields: [ 'podId' ] | ||
13 | }, | ||
14 | { | ||
15 | fields: [ 'requestId', 'podId' ], | ||
16 | unique: true | ||
17 | } | ||
18 | ], | ||
19 | classMethods: { | ||
20 | removeByRequestIdsAndPod | ||
21 | } | ||
22 | }) | ||
23 | |||
24 | return RequestToPod | ||
25 | } | ||
26 | |||
27 | // --------------------------------------------------------------------------- | ||
28 | |||
29 | function removeByRequestIdsAndPod (requestsIds, podId, callback) { | ||
30 | if (!callback) callback = function () {} | ||
31 | |||
32 | const query = { | ||
33 | where: { | ||
34 | requestId: { | ||
35 | $in: requestsIds | ||
36 | }, | ||
37 | podId: podId | ||
38 | } | ||
39 | } | ||
40 | |||
41 | this.destroy(query).asCallback(callback) | ||
42 | } | ||