[backend] Render pinned notes as links instead of objects

This commit is contained in:
Laura Hausmann 2024-05-31 20:52:54 +02:00
parent fb0ebd6079
commit d8a75cdd08
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 3 additions and 5 deletions

View file

@ -11,14 +11,14 @@ export default function (
totalItems: any,
first?: string,
last?: string,
orderedItems?: Record<string, unknown>[],
orderedItems?: (Record<string, unknown> | string)[],
): {
id: string | null;
type: "OrderedCollection";
totalItems: any;
first?: string;
last?: string;
orderedItems?: Record<string, unknown>[];
orderedItems?: (Record<string, unknown> | string)[];
} {
const page: any = {
id,

View file

@ -37,9 +37,7 @@ export default async (ctx: Router.RouterContext) => {
pinings.map((pining) => Notes.findOneByOrFail({ id: pining.noteId })),
);
const renderedNotes = await Promise.all(
pinnedNotes.map((note) => renderNote(note)),
);
const renderedNotes = pinnedNotes.map((note) => `${config.url}/notes/${note.id}`);
const rendered = renderOrderedCollection(
`${config.url}/users/${userId}/collections/featured`,