mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-02 02:41:34 +00:00
parent
482bdff3a4
commit
5303ae1d4b
16 changed files with 757 additions and 299 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const constants = require("../../lib/constants")
|
||||
const {fetchUser, fetchShortcode} = require("../../lib/collectors")
|
||||
const {fetchUser, getOrFetchShortcode} = require("../../lib/collectors")
|
||||
const {render} = require("pinski/plugins")
|
||||
|
||||
module.exports = [
|
||||
|
|
@ -33,8 +33,9 @@ module.exports = [
|
|||
},
|
||||
{
|
||||
route: `/p/(${constants.external.shortcode_regex})`, methods: ["GET"], code: async ({fill}) => {
|
||||
const post = await fetchShortcode(fill[0])
|
||||
await post.fetchExtendedOwner()
|
||||
const post = await getOrFetchShortcode(fill[0])
|
||||
await post.fetchChildren()
|
||||
await post.fetchExtendedOwnerP() // parallel await is okay since intermediate fetch result is cached
|
||||
return render(200, "pug/post.pug", {post})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue