The JSON responses I’m getting contain headers that match ‘entry_id’ which is redundant and not needed. The ‘1’:, ‘2’:, ‘3’:, etc…
Is there any way I can remove these headers from my results, either through the fetch itself, or some manipulation afterwards?
Fetch:
async function getEntries(){
const response = await fetch(url, {
headers: {
Authorization: `Basic ${btoa(`${username}:${password}`)}`
}
})
const json = await response.json();
return json;
};
Response:
{
'1': {
entry_id: '1',
user_id: '0',
date_created: '2023-09-21 16:17:10',
value: 'text',
},
'2': {
entry_id: '2',
user_id: '0',
date_created: '2023-09-27 15:57:43',
value: 'text',
},
'3': {
entry_id: '3',
user_id: '0',
date_created: '2023-09-29 20:21:33',
value: 'text',
}
}