mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 12:19:31 +02:00
first jackpot
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { BackendWebSocketJackpotUrl } from '@/properties/Сonfig.js';
|
||||
import { BackendApiUrl } from '@/properties/Сonfig.js';
|
||||
import { eventBus } from "@/main";
|
||||
|
||||
// import {
|
||||
@@ -53,3 +54,34 @@ export function ConnectToJackpotSocket() {
|
||||
console.error('Error in ConnectToChat:', error);
|
||||
}
|
||||
}
|
||||
|
||||
export async function JoinJackpotGame(userData, amount) {
|
||||
const data = {
|
||||
userCredentials: {
|
||||
searchToken: userData.searchToken,
|
||||
authtoken: userData.authtoken
|
||||
},
|
||||
bid: amount
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${BackendApiUrl}/GameJackpot/JoinJackpotGame`, {
|
||||
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