module.exports = async function (context, req) {
const name = context.bindingData.name;
contractAccount = await near.account(contractName)
switch (name) {
case 'get_sale':
get_sale_func(context, req);
break;
default:
break;
}
function get_sale_func(context, req) {
const busboy = new Busboy({ headers: req.headers });
busboy.on('field', function(fieldname, val) {
});
busboy.on('finish', function() {
log('Done parsing form!');
context.res = {
status: 200,
body: { result: "done" }
};
});
busboy.write(req.body, function() {});
}
It does not return this response.
context.res = {
status: 200,
body: { result: "done" }
};
But if I comment on this code contractAccount = await near.account(contractName)
of line 3, it works.
Is there any way to overcome this issue?