mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
added request-body for play saper
This commit is contained in:
@@ -53,4 +53,40 @@ export async function GetUserData(AUTHTOKEN, SearchToken) {
|
||||
catch (error) {
|
||||
console.log('Fetch error')
|
||||
}
|
||||
}
|
||||
|
||||
export async function ClickCirclePlay(InfoUser, ClickedCell) {
|
||||
const data = {
|
||||
PuttedMoney: InfoUser.PuttedMoney,
|
||||
MinesCount: InfoUser.MinesCount,
|
||||
UserCredentials: {
|
||||
SearchToken: InfoUser.SearchToken,
|
||||
AUTHTOKEN: InfoUser.AUTHTOKEN
|
||||
},
|
||||
ClickedCell: {
|
||||
X: ClickedCell.X,
|
||||
y: ClickedCell.Y
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BackendApiUrl}/GameMines/Play`, {
|
||||
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.json())
|
||||
return await response.json()
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Fetch error')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user