flamelink / flamelink-js-sdk

🦊 Official Flamelink JavaScript SDK for both the Firebase Realtime database and Cloud Firestore
https://flamelink.github.io/flamelink-js-sdk
MIT License
43 stars 5 forks source link

Can't render images #150

Closed Hjkun77 closed 3 years ago

Hjkun77 commented 4 years ago

Here's my stackoverflow question. Hope you can help me generate images that i uploaded through flamelink and is now referenced at firestore and stored in firebase

https://stackoverflow.com/questions/62246059/i-cant-load-images-from-flamelink-that-is-integrated-with-firebase-and-vue

Thanks again

gitdubz commented 3 years ago

Hi I have responded to the query on stack-overflow

You can do the following

app.content
  .get({
    schemaKey: "teamPage",
    populate: [
      {
        field: "title"
      },
      {
        field: "description"
      },
      {
        field: "executiveBoard",
        fields: [
          "title",
          "position",
          "image",
          "facebook",
          "github",
          "linkedin"
        ],
        populate: ["image"]
      }
    ]
  })

note the populate: ["image"] addition (see this)

this.teamPage.executiveBoard[0].image will now be an array of objects example
[{ 
  contentType: "image/png",
  id: "xxx",
  ...
  url: "https://firebasestorage.googleapis.com/v0/b/....."
}]

you can then access the url for example like this

this.teamPage.executiveBoard[0].image[0].url
gitdubz commented 3 years ago

Transferring issue to flamelink-js-sdk