✌️
This commit is contained in:
parent
482c86a25a
commit
a2ed259501
6 changed files with 86 additions and 6 deletions
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
import $ from 'cafy';
|
||||
import User from '../../models/user';
|
||||
import event from '../../event';
|
||||
|
||||
module.exports = async (params, user) => new Promise(async (res, rej) => {
|
||||
// Get 'home' parameter
|
||||
|
|
@ -30,6 +31,10 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
|
|||
});
|
||||
|
||||
res();
|
||||
|
||||
event(user._id, 'home_updated', {
|
||||
home
|
||||
});
|
||||
} else {
|
||||
if (id == null && data == null) return rej('you need to set id and data params if home param unset');
|
||||
|
||||
|
|
@ -47,5 +52,9 @@ module.exports = async (params, user) => new Promise(async (res, rej) => {
|
|||
});
|
||||
|
||||
res();
|
||||
|
||||
event(user._id, 'home_updated', {
|
||||
id, data
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue