mirror of
https://github.com/wassname/talk.git
synced 2026-07-01 04:51:32 +08:00
20 lines
496 B
JavaScript
20 lines
496 B
JavaScript
const { get } = require('lodash');
|
|
|
|
module.exports = {
|
|
User: {
|
|
notificationSettings(user, args, { user: currentUser }) {
|
|
if (
|
|
currentUser &&
|
|
(currentUser.id === user.id || currentUser.can('VIEW_USER_STATUS'))
|
|
) {
|
|
return get(user, 'metadata.notifications.settings', {});
|
|
}
|
|
},
|
|
},
|
|
RootMutation: {
|
|
async updateNotificationSettings(obj, { input }, { mutators: { User } }) {
|
|
await User.updateNotificationSettings(input);
|
|
},
|
|
},
|
|
};
|