Use relative paths for images

This commit is contained in:
2025-11-17 15:16:37 +13:00
parent 7958e4b7f5
commit deac573d30
2 changed files with 2 additions and 2 deletions

View File

@@ -11,7 +11,7 @@ const records = await pb.collection('recipes').getFullList()
const recipes = records.map(r => new Recipe(r.cooklang)) const recipes = records.map(r => new Recipe(r.cooklang))
const ids = records.map(r => r.id) const ids = records.map(r => r.id)
const images = await Promise.all( const images = await Promise.all(
records.map(r => pb.files.getURL(r, r.images[0])) // get first image from each recipe as a cover image records.map(r => pb.files.getURL(r, r.images[0]).substring(21)) // get first image from each recipe as a cover image
) )
--- ---

View File

@@ -16,7 +16,7 @@ const re = await pb.collection('recipes').getOne(id as string)
let recipeData = new Recipe(re.cooklang) let recipeData = new Recipe(re.cooklang)
const images = await Promise.all( const images = await Promise.all(
re.images.map(r => pb.files.getURL(re, r)) re.images.map(r => pb.files.getURL(re, r).substring(21))
) )
--- ---