I've got this string values for post API
example data:
const value ={
id:'1234567',
parameters:'temp'
}
const dataPower = {}
dataPower[values.id]= [values.parameters]
const ReportData ={
"data":dataPower
"dateRange": {
"startDate": startDate,
"endDate": endDate
}
}
it work good but I should create this format and pass to Api :
{
"data": {
"id1": [
"temp",
"power"
],
"id2": [
"irradiance"
]
},
"dateRange": {
"startDate": "2023-05-08T00:00:00.000+00:00",
"endDate": "2023-05-08T12:00:00.000+00:00"
}
}
How should I develop my code ?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/pRK8Ccz
Comments
Post a Comment