I have a backend function
import axios from ‘axios’ ;
let url = “”
export async function backendgetfunction ( args ) {
const data = { “key” : args }
let handshake = {}
await axios ({
method: ‘post’ , url: ` url ,
headers: { “Content-Type” : “multipart/form-data” },
data: data
}). then ( function ( response ) {
handshake = response . data ;
console . log ( handshake );
return handshake
})
. catch ( function ( error ) {
console . log ( error );
});
}
And a function calling this function from the frontend
export async function getfunction_click ( event ) {
console . log ( ‘1’ );
$w ( “#button1” ). disable ();
let args = $w ( “#args” ). value ;
console . log ( ‘Calling backendgetfunction…’ );
let result = await backendgetfunction ( auction_tag , text );
$w ( “#button1” ). enable ();
console . log ( ‘backendgetRfunction returned’ , result );
}
getfunction_click()
is triggered by clicking the #button1. The API request is working fine as console.log(handshake) works as intended and I can also track the request on server side.
However, the issue I am facing is that the function from the backend gets stuck and the last two lines of getfuction_click() does not get executed, button stays disabled.
I do not know if it is relevant or not but the I started facing this issue after GitHub integration. Prior to that the similar code was working just fine.
All inputs will be greatly appreciated.