mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 20:29:35 +02:00
added request for get percentage-steps in saper-game
This commit is contained in:
28
luckydiamond/src/assets/js/games/saper/SaperAPI.js
Normal file
28
luckydiamond/src/assets/js/games/saper/SaperAPI.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { BackendApiUrl } from '@/properties/Сonfig.js';
|
||||
|
||||
export async function GetPercentageSteps(CrystalsCount) {
|
||||
const data = {
|
||||
minesCount: CrystalsCount
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BackendApiUrl}/GameMines/GetMultiplierPercentage`, {
|
||||
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!')
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user