テーブル分割

This commit is contained in:
syuilo
2019-04-10 15:04:27 +09:00
parent 9603f3fa4f
commit 626cfb61ac
33 changed files with 267 additions and 232 deletions

View File

@@ -2,7 +2,7 @@ import watch from '../../../services/note/watch';
import { publishNoteStream } from '../../stream';
import { User } from '../../../models/entities/user';
import { Note } from '../../../models/entities/note';
import { PollVotes, Users, NoteWatchings, Polls } from '../../../models';
import { PollVotes, Users, NoteWatchings, Polls, UserProfiles } from '../../../models';
import { Not } from 'typeorm';
import { genId } from '../../../misc/gen-id';
import { createNotification } from '../../create-notification';
@@ -67,8 +67,10 @@ export default (user: User, note: Note, choice: number) => new Promise(async (re
}
});
const profile = await UserProfiles.findOne({ userId: user.id });
// ローカルユーザーが投票した場合この投稿をWatchする
if (Users.isLocalUser(user) && user.autoWatch) {
if (Users.isLocalUser(user) && profile.autoWatch) {
watch(user.id, note);
}
});