Simple cards displaying and actions.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user