Use relative paths for images
This commit is contained in:
@@ -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
|
||||||
)
|
)
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -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))
|
||||||
)
|
)
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user