i want to make axios request from other axios response. and combine the console.log
i have already try
const data1 = axios.get(`https://website.com/json1respon`).then(({ data }) => {
const data2 = axios
.get(`https://website2.com/${data.data.product}`)
.then(({ data }) => {});
});
console.log(data1, data2);
json response website 1
{
"data": {
"trx_id": "T221129CEVD013700",
"ref_id": "YEPE-780HM434",
"destination": "101216575|2522",
"product": "344",
"status": "Sukses",
"sn": "мυн. яιfqу29. RefId : S221129031615475TPZI",
},
"status": 1
}
json respon website 2
{
"data": {
"res": 75000,
"pbl": 80000
}
}
so i want to combine like this
status : ${data.data.status}
serial : ${data.data.sn}
product : ${data.data.product}
price : ${data.data.pbl}
when i try it separate each other