fix: アンテナの既読 (#7803)

from: a89742319c
This commit is contained in:
sousuke0422 2021-09-18 13:30:28 +09:00 committed by GitHub
parent 47183e07fc
commit eeaff3801f

View file

@ -1,6 +1,7 @@
import $ from 'cafy'; import $ from 'cafy';
import { ID } from '@/misc/cafy-id'; import { ID } from '@/misc/cafy-id';
import define from '../../define'; import define from '../../define';
import readNote from '@/services/note/read';
import { Antennas, Notes, AntennaNotes } from '@/models/index'; import { Antennas, Notes, AntennaNotes } from '@/models/index';
import { makePaginationQuery } from '../../common/make-pagination-query'; import { makePaginationQuery } from '../../common/make-pagination-query';
import { generateVisibilityQuery } from '../../common/generate-visibility-query'; import { generateVisibilityQuery } from '../../common/generate-visibility-query';
@ -84,5 +85,9 @@ export default define(meta, async (ps, user) => {
.take(ps.limit!) .take(ps.limit!)
.getMany(); .getMany();
if (notes.length > 0) {
readNote(user.id, notes);
}
return await Notes.packMany(notes, user); return await Notes.packMany(notes, user);
}); });