i am trying to fetch a series api-data. as per below api-data each series have their own data, for e.g a series "bannerData" have their data id,banner_title... and next series "homecatData" have their data like id,category_title... and so on up to last series.
in my case, endpoint api is "http://localhost:8000/api/homepage/"
how to fetch this data in reactjs?
i am probably new to reactjs. it would be great if anybody could help me out what i am trying to solve is. thank you so much in advance.
{
"bannerData": [
{
"id": 2,
"banner_title": "CORONA sell",
"banner_image": "http://localhost:8000/media/hero_man.png",
"discount_price": 86,
"product_category": "7"
}
],
"homecatData": [
{
"id": 7,
"category_title": "new-arrival",
"category_slug": "new-arrival",
"category_description": "",
"category_image": "http://localhost:8000/media/cat2.jpg"
},
],
"homeproductData": [
{
"_id": 9,
"product_title": "product05",
"product_price": 21,
"product_image": "http://localhost:8000/media/product4_JOvGftO.png",
"product_new": false
},
{
"_id": 7,
"product_title": "product03",
"product_price": 21,
"product_image": "http://localhost:8000/media/product3.png",
"product_new": false
},
],
}