added API to get-userdata for saper

This commit is contained in:
Kostya
2024-01-20 23:51:20 +03:00
parent 7bb8d4d504
commit c5746aea6b
2 changed files with 46 additions and 1 deletions

View File

@@ -25,4 +25,32 @@ export async function GetPercentageSteps(CrystalsCount) {
catch (error) {
console.log('Fetch Error!')
}
}
export async function GetUserData(SearchToken, AuthToken) {
const data = {
SearchToken: SearchToken,
Authtoken: AuthToken
}
try {
const response = await fetch(`${BackendApiUrl}/GameMines/GetCurrentData`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data),
redirect: 'follow'
})
if (!response.ok) {
console.log('Fetch error:', response.status)
}
console.log(response)
return await response.json()
}
catch (error) {
console.log('Fetch error')
}
}