I am getting an error on a simple JS
Here is the JSON being sent. Very simple:
{
"status": "Paid",
"businessId": "133",
"loanamount": 50001
}
Here is my code:
export async function post_editBusiness(request)
{
let options = {
"headers": {
"Content-Type": "application/json"
}
};
let opt = {
"suppressAuth": true,
"suppressHooks": false
};
//get the request body
return request.body.text()
.then( (body) => {
let obj = JSON.parse(body)
Let businessId = obj("businessId").toString()
let loanamount = obj("loanamount").toString()
} );
}
And when running in the console, I always get this error:
obj is not a function
If someone can help me solve this simple (but annoying) issue, I would greatly appreciate it!
Thanks!