]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/models/requestToPod.js
First version with PostgreSQL
[github/Chocobozzz/PeerTube.git] / server / models / requestToPod.js
CommitLineData
feb4bdfd
C
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}