Feat : add ability to use tokens
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user