Simple cards displaying and actions.

This commit is contained in:
aminecmi
2021-10-30 16:27:29 +02:00
parent 1b2fbfc7f8
commit 2bfcc80f0e
7 changed files with 82 additions and 63 deletions
+20
View File
@@ -0,0 +1,20 @@
export async function getHand() {
const response = await fetch('http://localhost:8080/api/deck/hand');
return await response.json();
}
export async function sortHand(hand) {
const response = await fetch(`http://localhost:8080/api/deck/hand:sort`, {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(hand)
})
return await response.json();
}
export async function resetDeck() {
const response = await fetch(`http://localhost:8080/api/deck:reset`, {
method: 'PUT'
})
await response;
}