- Create Newsletter Page: MailingList (without the class style, using Gulp tasks)#94
This commit is contained in:
29
src/server/router/api/actions.js
Normal file
29
src/server/router/api/actions.js
Normal file
@@ -0,0 +1,29 @@
|
||||
var mongoose = require('mongoose');
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
|
||||
module.exports = {
|
||||
doOtherThingsAfterDeleted: async 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: async function (tablename, myrec, mynewrec) {
|
||||
try {
|
||||
if (tablename === 'users') {
|
||||
// Delete also all the subscribers record of this User
|
||||
|
||||
}
|
||||
return { myrec }
|
||||
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user