Feat : add ability to use tokens

This commit is contained in:
2024-07-13 21:37:55 +02:00
parent 2709bb799c
commit b1c9644941
5 changed files with 65 additions and 7 deletions
+18
View File
@@ -124,6 +124,24 @@ export async function buyGem(game: string) {
);
}
export async function useToken(
game: string,
tokenId: string,
cardId: string,
playerId?: string
) {
const config = useRuntimeConfig();
await $fetch(
new URL(`games/${game}/turn/useToken/${tokenId}`, config.public.endpoint)
.href,
{
method: "POST",
credentials: "include",
body: { cardId, playerId },
}
);
}
export async function lockEffect(game: string, effectId: string) {
const config = useRuntimeConfig();
await $fetch(