I'm noticing that the JSON responses I receive include redundant keys like 'entry_id', which are unnecessary. The '1':, '2':, '3':, and so on...
Is there a way to eliminate these keys from the results either during the fetch process or through manipulation afterwards?
Code for Fetch:
async function getEntries(){
const response = await fetch(url, {
headers: {
Authorization: `Basic ${btoa(`${username}:${password}`)}`
}
})
const json = await response.json();
return json;
};
Here is an example 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',
}
}