added request for get percentage-steps in saper-game

This commit is contained in:
Kostya
2024-01-19 21:20:21 +03:00
parent b25141b781
commit e74e51b35e
2 changed files with 50 additions and 1 deletions

View 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!')
}
}