fix(api): 🐛 Don't use URL in Versia entity schemas, fixes OpenAPI

This commit is contained in:
Jesse Wierzbinski 2025-04-16 16:35:17 +02:00
parent 0a712128a5
commit a2e907390f
No known key found for this signature in database
12 changed files with 131 additions and 102 deletions

View file

@ -98,28 +98,28 @@ export default apiRoute((app) =>
first: new URL(
`/users/${uuid}/outbox?page=1`,
config.http.base_url,
),
).href,
last: new URL(
`/users/${uuid}/outbox?page=${Math.ceil(
totalNotes / NOTES_PER_PAGE,
)}`,
config.http.base_url,
),
).href,
total: totalNotes,
author: author.uri,
author: author.uri.href,
next:
notes.length === NOTES_PER_PAGE
? new URL(
`/users/${uuid}/outbox?page=${pageNumber + 1}`,
config.http.base_url,
)
).href
: null,
previous:
pageNumber > 1
? new URL(
`/users/${uuid}/outbox?page=${pageNumber - 1}`,
config.http.base_url,
)
).href
: null,
items: notes.map((note) => note.toVersia()),
});