Skip to content

Commit

Permalink
fix: docs url
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Oct 23, 2024
1 parent a6dbf19 commit 844bab4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/functions/admin/files/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ export const admin = defineAkteFile<GlobalData>().from({
album.url = `${album.url}-${await sha256(album.uid!, process.env.PRISMIC_TOKEN!, 7)}`
}

for (const doc of docs) {
if (!doc.url) {
throw new Error(
`Unable to resolve URL for doc: ${JSON.stringify(doc)}`,
)
}
doc.url = `${doc.url}-${await sha256(doc.uid!, process.env.PRISMIC_TOKEN!, 7)}`
}

return { albums, docs }
},
render(context) {
Expand Down

0 comments on commit 844bab4

Please sign in to comment.