wip: email notification
This commit is contained in:
parent
2d3248504b
commit
ebadd7fd3f
20 changed files with 355 additions and 159 deletions
|
@ -161,6 +161,10 @@ export const meta = {
|
|||
mutingNotificationTypes: {
|
||||
validator: $.optional.arr($.str.or(notificationTypes as unknown as string[]))
|
||||
},
|
||||
|
||||
emailNotificationTypes: {
|
||||
validator: $.optional.arr($.str)
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
|
@ -206,7 +210,7 @@ export default define(meta, async (ps, user, token) => {
|
|||
|
||||
if (ps.name !== undefined) updates.name = ps.name;
|
||||
if (ps.description !== undefined) profileUpdates.description = ps.description;
|
||||
//if (ps.lang !== undefined) updates.lang = ps.lang;
|
||||
if (ps.lang !== undefined) profileUpdates.lang = ps.lang;
|
||||
if (ps.location !== undefined) profileUpdates.location = ps.location;
|
||||
if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday;
|
||||
if (ps.avatarId !== undefined) updates.avatarId = ps.avatarId;
|
||||
|
@ -226,6 +230,7 @@ export default define(meta, async (ps, user, token) => {
|
|||
if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
|
||||
if (typeof ps.receiveAnnouncementEmail === 'boolean') profileUpdates.receiveAnnouncementEmail = ps.receiveAnnouncementEmail;
|
||||
if (typeof ps.alwaysMarkNsfw === 'boolean') profileUpdates.alwaysMarkNsfw = ps.alwaysMarkNsfw;
|
||||
if (ps.emailNotificationTypes !== undefined) profileUpdates.emailNotificationTypes = ps.emailNotificationTypes;
|
||||
|
||||
if (ps.avatarId) {
|
||||
const avatar = await DriveFiles.findOne(ps.avatarId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue