mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-28 21:08:52 -07:00
[backend] Actually utilize packed user cache in notes.packMany
This commit is contained in:
parent
913f1659b3
commit
7c5bc06bb8
1 changed files with 2 additions and 3 deletions
|
@ -30,8 +30,6 @@ import { db } from "@/db/postgre.js";
|
||||||
import { IdentifiableError } from "@/misc/identifiable-error.js";
|
import { IdentifiableError } from "@/misc/identifiable-error.js";
|
||||||
import { PackedUserCache } from "@/models/repositories/user.js";
|
import { PackedUserCache } from "@/models/repositories/user.js";
|
||||||
import { isFiltered } from "@/misc/is-filtered.js";
|
import { isFiltered } from "@/misc/is-filtered.js";
|
||||||
import { UserProfile } from "@/models/entities/user-profile.js";
|
|
||||||
import { Cache } from "@/misc/cache.js";
|
|
||||||
|
|
||||||
export async function populatePoll(note: Note, meId: User["id"] | null) {
|
export async function populatePoll(note: Note, meId: User["id"] | null) {
|
||||||
const poll = await Polls.findOneByOrFail({ noteId: note.id });
|
const poll = await Polls.findOneByOrFail({ noteId: note.id });
|
||||||
|
@ -330,6 +328,7 @@ export const NoteRepository = db.getRepository(Note).extend({
|
||||||
options?: {
|
options?: {
|
||||||
detail?: boolean;
|
detail?: boolean;
|
||||||
},
|
},
|
||||||
|
userCache: PackedUserCache = Users.getFreshPackedUserCache(),
|
||||||
) {
|
) {
|
||||||
if (notes.length === 0) return [];
|
if (notes.length === 0) return [];
|
||||||
|
|
||||||
|
@ -377,7 +376,7 @@ export const NoteRepository = db.getRepository(Note).extend({
|
||||||
myReactions: myReactionsMap,
|
myReactions: myReactionsMap,
|
||||||
myRenotes: myRenotesMap
|
myRenotes: myRenotesMap
|
||||||
},
|
},
|
||||||
}),
|
}, userCache),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue