mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-13 16:01:34 +02:00
feat(invitations): oper/admin can delete All Expired Official Invitation
#20
This commit is contained in:
@@ -100,6 +100,30 @@ exports.listOfficial = function (req, res) {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* deleteExpiredOfficialInvitation
|
||||
* @param req
|
||||
* @param res
|
||||
*/
|
||||
exports.deleteExpiredOfficialInvitation = function (req, res) {
|
||||
Invitation.remove({
|
||||
isOfficial: true,
|
||||
status: 1,
|
||||
expiresat: {$lt: Date.now()}
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
return res.status(422).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
} else {
|
||||
res.json({
|
||||
message: 'SERVER.DELETE_EXPIRED_OFFICIAL_INVITATION_OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* List of Invitations
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user