refactor: PackedHoge型をPacked<'Hoge'>型に書き換える (#7792)
* packedNotificationSchemaを更新 * read:gallery, write:gallery, read:gallery-likes, write:gallery-likesに翻訳を追加 * fix * add header, choice, invitation * test * fix * yatta * remove no longer needed "as PackedUser/PackedNote" * clean up * add simple-schema * fix lint * define items in full Schema * revert https://github.com/misskey-dev/misskey/pull/7772#discussion_r706627736 * user packとnote packの型不整合を修正 * add prelude/types.ts * emoji * signin * game * matching * fix * add emoji schema * add reversiGame * add reversiMatching * remove signin schema (use Signin entity) * add Packed type * note-reaction * user * user-group * user-list * note * app, messaging-message * notification * drive-file * drive-folder * following * muting * blocking * hashtag * page * app (with modifying schema) * import user? * channel * antenna * clip * gallery-post * emoji * Packed * reversi-matching * add changelog * add changelog * revert fix
This commit is contained in:
parent
bea42f5804
commit
14795b68f2
35 changed files with 312 additions and 122 deletions
|
|
@ -6,15 +6,15 @@ import { Not, IsNull, In } from 'typeorm';
|
|||
import { Channel } from '@/models/entities/channel';
|
||||
import { checkHitAntenna } from '@/misc/check-hit-antenna';
|
||||
import { getAntennas } from '@/misc/antenna-cache';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { readNotificationByQuery } from '@/server/api/common/read-notification';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
/**
|
||||
* Mark notes as read
|
||||
*/
|
||||
export default async function(
|
||||
userId: User['id'],
|
||||
notes: (Note | PackedNote)[],
|
||||
notes: (Note | Packed<'Note'>)[],
|
||||
info?: {
|
||||
following: Set<User['id']>;
|
||||
followingChannels: Set<Channel['id']>;
|
||||
|
|
@ -34,10 +34,10 @@ export default async function(
|
|||
})).map(x => x.followeeId));
|
||||
|
||||
const myAntennas = (await getAntennas()).filter(a => a.userId === userId);
|
||||
const readMentions: (Note | PackedNote)[] = [];
|
||||
const readSpecifiedNotes: (Note | PackedNote)[] = [];
|
||||
const readChannelNotes: (Note | PackedNote)[] = [];
|
||||
const readAntennaNotes: (Note | PackedNote)[] = [];
|
||||
const readMentions: (Note | Packed<'Note'>)[] = [];
|
||||
const readSpecifiedNotes: (Note | Packed<'Note'>)[] = [];
|
||||
const readChannelNotes: (Note | Packed<'Note'>)[] = [];
|
||||
const readAntennaNotes: (Note | Packed<'Note'>)[] = [];
|
||||
|
||||
for (const note of notes) {
|
||||
if (note.mentions && note.mentions.includes(userId)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue