aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/requestToPod.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/requestToPod.js')
-rw-r--r--server/models/requestToPod.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/server/models/requestToPod.js b/server/models/requestToPod.js
new file mode 100644
index 000000000..378c2bdcf
--- /dev/null
+++ b/server/models/requestToPod.js
@@ -0,0 +1,30 @@
1'use strict'
2
3// ---------------------------------------------------------------------------
4
5module.exports = function (sequelize, DataTypes) {
6 const RequestToPod = sequelize.define('RequestToPod', {}, {
7 classMethods: {
8 removePodOf
9 }
10 })
11
12 return RequestToPod
13}
14
15// ---------------------------------------------------------------------------
16
17function 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}