refactor(server): rename settings to user-settings (#11161)
This commit is contained in:
@@ -89,7 +89,7 @@ test('should create invitation notification and email', async t => {
|
||||
test('should not send invitation email if user setting is not to receive invitation email', async t => {
|
||||
const { notificationService } = t.context;
|
||||
const inviteId = randomUUID();
|
||||
await t.context.models.settings.set(member.id, {
|
||||
await t.context.models.userSettings.set(member.id, {
|
||||
receiveInvitationEmail: false,
|
||||
});
|
||||
const invitationMailCount = t.context.module.mails.count('MemberInvitation');
|
||||
@@ -150,7 +150,7 @@ test('should not send invitation accepted email if user settings is not receive
|
||||
const { notificationService } = t.context;
|
||||
const inviteId = randomUUID();
|
||||
// should not send email if user settings is not receive invitation email
|
||||
await t.context.models.settings.set(owner.id, {
|
||||
await t.context.models.userSettings.set(owner.id, {
|
||||
receiveInvitationEmail: false,
|
||||
});
|
||||
const invitationAcceptedMailCount =
|
||||
@@ -560,7 +560,7 @@ test('should send mention email by user setting', async t => {
|
||||
|
||||
// update user setting to not receive mention email
|
||||
const mentionMailCount = t.context.module.mails.count('Mention');
|
||||
await t.context.models.settings.set(member.id, {
|
||||
await t.context.models.userSettings.set(member.id, {
|
||||
receiveMentionEmail: false,
|
||||
});
|
||||
await notificationService.createMention({
|
||||
|
||||
@@ -45,7 +45,7 @@ export class NotificationService {
|
||||
}
|
||||
|
||||
private async sendMentionEmail(input: MentionNotificationCreate) {
|
||||
const userSetting = await this.models.settings.get(input.userId);
|
||||
const userSetting = await this.models.userSettings.get(input.userId);
|
||||
if (!userSetting.receiveMentionEmail) {
|
||||
return;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ export class NotificationService {
|
||||
// make it easier to test in dev mode
|
||||
this.logger.debug(`Invite link: ${inviteUrl}`);
|
||||
}
|
||||
const userSetting = await this.models.settings.get(input.userId);
|
||||
const userSetting = await this.models.userSettings.get(input.userId);
|
||||
if (!userSetting.receiveInvitationEmail) {
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ export class NotificationService {
|
||||
const inviterUserId = input.userId;
|
||||
const inviteeUserId = input.body.createdByUserId;
|
||||
const workspaceId = input.body.workspaceId;
|
||||
const userSetting = await this.models.settings.get(inviterUserId);
|
||||
const userSetting = await this.models.userSettings.get(inviterUserId);
|
||||
if (!userSetting.receiveInvitationEmail) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user