diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-10 14:48:08 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:51 +0100 |
commit | 38fa2065831b5f55be0d7f30f19a62c967397208 (patch) | |
tree | 4a986465e3a88c85bc6a8b5fc992e0f2edd63ef0 /server/models/request/request-to-pod.ts | |
parent | 0d0e8dd0904b380b70e19ebcb4763d65601c4632 (diff) | |
download | PeerTube-38fa2065831b5f55be0d7f30f19a62c967397208.tar.gz PeerTube-38fa2065831b5f55be0d7f30f19a62c967397208.tar.zst PeerTube-38fa2065831b5f55be0d7f30f19a62c967397208.zip |
Remove references to author
Diffstat (limited to 'server/models/request/request-to-pod.ts')
-rw-r--r-- | server/models/request/request-to-pod.ts | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/server/models/request/request-to-pod.ts b/server/models/request/request-to-pod.ts deleted file mode 100644 index 4e14e918b..000000000 --- a/server/models/request/request-to-pod.ts +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | import { addMethodsToModel } from '../utils' | ||
4 | import { | ||
5 | RequestToPodInstance, | ||
6 | RequestToPodAttributes, | ||
7 | |||
8 | RequestToPodMethods | ||
9 | } from './request-to-pod-interface' | ||
10 | |||
11 | let RequestToPod: Sequelize.Model<RequestToPodInstance, RequestToPodAttributes> | ||
12 | let removeByRequestIdsAndPod: RequestToPodMethods.RemoveByRequestIdsAndPod | ||
13 | |||
14 | export default function (sequelize: Sequelize.Sequelize, DataTypes: Sequelize.DataTypes) { | ||
15 | RequestToPod = sequelize.define<RequestToPodInstance, RequestToPodAttributes>('RequestToPod', {}, { | ||
16 | indexes: [ | ||
17 | { | ||
18 | fields: [ 'requestId' ] | ||
19 | }, | ||
20 | { | ||
21 | fields: [ 'podId' ] | ||
22 | }, | ||
23 | { | ||
24 | fields: [ 'requestId', 'podId' ], | ||
25 | unique: true | ||
26 | } | ||
27 | ] | ||
28 | }) | ||
29 | |||
30 | const classMethods = [ | ||
31 | removeByRequestIdsAndPod | ||
32 | ] | ||
33 | addMethodsToModel(RequestToPod, classMethods) | ||
34 | |||
35 | return RequestToPod | ||
36 | } | ||
37 | |||
38 | // --------------------------------------------------------------------------- | ||
39 | |||
40 | removeByRequestIdsAndPod = function (requestsIds: number[], podId: number) { | ||
41 | const query = { | ||
42 | where: { | ||
43 | requestId: { | ||
44 | [Sequelize.Op.in]: requestsIds | ||
45 | }, | ||
46 | podId: podId | ||
47 | } | ||
48 | } | ||
49 | |||
50 | return RequestToPod.destroy(query) | ||
51 | } | ||