]>
Commit | Line | Data |
---|---|---|
feb4bdfd C |
1 | 'use strict' |
2 | ||
3 | // --------------------------------------------------------------------------- | |
4 | ||
5 | module.exports = function (sequelize, DataTypes) { | |
6 | const RequestToPod = sequelize.define('RequestToPod', {}, { | |
7 | classMethods: { | |
8 | removePodOf | |
9 | } | |
10 | }) | |
11 | ||
12 | return RequestToPod | |
13 | } | |
14 | ||
15 | // --------------------------------------------------------------------------- | |
16 | ||
17 | function removePodOf (requestsIds, podId, callback) { | |
18 | if (!callback) callback = function () {} | |
19 | ||
20 | const query = { | |
21 | where: { | |
22 | requestId: { | |
23 | $in: requestsIds | |
24 | }, | |
25 | podId: podId | |
26 | } | |
27 | } | |
28 | ||
29 | this.destroy(query).asCallback(callback) | |
30 | } |