Files
freeplanet_serverside/server/router/api/actions.js

28 lines
646 B
JavaScript
Raw Normal View History

var mongoose = require('mongoose');
const Subscription = mongoose.model('subscribers');
module.exports = {
doOtherThingsAfterDeleted: function (tablename, rec) {
try {
if (tablename === 'users') {
// Delete also all the subscribers record of this User
return Subscription.remove({ userId: rec._id })
}
} catch (e) {
return false
}
return true;
},
doOtherThingsAfterDuplicated: function (tablename, rec) {
try {
if (tablename === 'users') {
// Delete also all the subscribers record of this User
}
} catch (e) {
return false
}
return true;
}
};