When running getTicket ()
Alert (JSON.stringify (responseJson));
Data is recovered properly But in listTicket (), the other data is shown to me My code is as follows
getTicket:
async getTicket ()
{
try {
let response = await fetch(
'url'
,{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
uid: '1',
type: '0',
})
});
let responseJson = await response.json();
alert(JSON.stringify(responseJson));
return responseJson;
} catch (error) {
alert(error);
}
}
listTicket code:
listTicket()
{
let objectTicket = this.getTicket();
alert(JSON.stringify(objectTicket));
}
please help