mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 09:57:29 -07:00
[backend] Render pinned notes as links instead of objects
This commit is contained in:
parent
fb0ebd6079
commit
d8a75cdd08
2 changed files with 3 additions and 5 deletions
|
@ -11,14 +11,14 @@ export default function (
|
||||||
totalItems: any,
|
totalItems: any,
|
||||||
first?: string,
|
first?: string,
|
||||||
last?: string,
|
last?: string,
|
||||||
orderedItems?: Record<string, unknown>[],
|
orderedItems?: (Record<string, unknown> | string)[],
|
||||||
): {
|
): {
|
||||||
id: string | null;
|
id: string | null;
|
||||||
type: "OrderedCollection";
|
type: "OrderedCollection";
|
||||||
totalItems: any;
|
totalItems: any;
|
||||||
first?: string;
|
first?: string;
|
||||||
last?: string;
|
last?: string;
|
||||||
orderedItems?: Record<string, unknown>[];
|
orderedItems?: (Record<string, unknown> | string)[];
|
||||||
} {
|
} {
|
||||||
const page: any = {
|
const page: any = {
|
||||||
id,
|
id,
|
||||||
|
|
|
@ -37,9 +37,7 @@ export default async (ctx: Router.RouterContext) => {
|
||||||
pinings.map((pining) => Notes.findOneByOrFail({ id: pining.noteId })),
|
pinings.map((pining) => Notes.findOneByOrFail({ id: pining.noteId })),
|
||||||
);
|
);
|
||||||
|
|
||||||
const renderedNotes = await Promise.all(
|
const renderedNotes = pinnedNotes.map((note) => `${config.url}/notes/${note.id}`);
|
||||||
pinnedNotes.map((note) => renderNote(note)),
|
|
||||||
);
|
|
||||||
|
|
||||||
const rendered = renderOrderedCollection(
|
const rendered = renderOrderedCollection(
|
||||||
`${config.url}/users/${userId}/collections/featured`,
|
`${config.url}/users/${userId}/collections/featured`,
|
||||||
|
|
Loading…
Reference in a new issue