const testFunc = () => {
let test = [];
axios
.post('test.com', {
filters: [
{
comparison: 'eq',
fieldName: 'ID',
fieldValue: `${id}`,
},
],
}).then(({ data }) => test = data);
return test;
}
I need to write to the variable what I get in the response, but the attempt to do this ends with nothing being written to the variable