Fixed packing errors
This commit is contained in:
parent
eab77d9225
commit
15892a8efa
|
@ -4,7 +4,6 @@ import {Users} from "../index.js";
|
||||||
import type {Packed} from "@/misc/schema.js";
|
import type {Packed} from "@/misc/schema.js";
|
||||||
import {convertLegacyReaction} from "@/misc/reaction-lib.js";
|
import {convertLegacyReaction} from "@/misc/reaction-lib.js";
|
||||||
import type {User} from "@/models/entities/user.js";
|
import type {User} from "@/models/entities/user.js";
|
||||||
import {getNote} from "@/server/api/common/getters.js";
|
|
||||||
|
|
||||||
export const NoteReactionRepository = db.getRepository(NoteReaction).extend({
|
export const NoteReactionRepository = db.getRepository(NoteReaction).extend({
|
||||||
async pack(
|
async pack(
|
||||||
|
@ -32,7 +31,7 @@ export const NoteReactionRepository = db.getRepository(NoteReaction).extend({
|
||||||
...(opts.withNote
|
...(opts.withNote
|
||||||
? {
|
? {
|
||||||
// may throw error
|
// may throw error
|
||||||
note: getNote(reaction.noteId, me),
|
note: { id: reaction.noteId },
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
|
@ -166,7 +166,7 @@ async function mergePack(
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: "Note",
|
type: "Note",
|
||||||
note,
|
object: note,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue