From 90dfe57a4958bc279307470d05b35166b6fe0da9 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sun, 14 Jul 2024 17:05:11 +0200 Subject: [PATCH] Fix : add missing slash on routes --- netcode/index.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/netcode/index.ts b/netcode/index.ts index 10c78e4..b73725a 100644 --- a/netcode/index.ts +++ b/netcode/index.ts @@ -56,7 +56,7 @@ export async function createGame() { export async function startGame(game: string) { const config = useRuntimeConfig(); const res = await $fetch( - config.public.endpoint + `games/${game}/start`, + config.public.endpoint + `/games/${game}/start`, { method: "POST", credentials: "include", @@ -67,7 +67,7 @@ export async function startGame(game: string) { export async function joinGame(game: string) { const config = useRuntimeConfig(); const res = await $fetch( - config.public.endpoint + `games/${game}/join`, + config.public.endpoint + `/games/${game}/join`, { method: "POST", credentials: "include", @@ -77,7 +77,7 @@ export async function joinGame(game: string) { export async function endTurn(game: string) { const config = useRuntimeConfig(); - await $fetch(config.public.endpoint + `games/${game}/endTurn`, { + await $fetch(config.public.endpoint + `/games/${game}/endTurn`, { method: "POST", credentials: "include", }); @@ -86,7 +86,7 @@ export async function endTurn(game: string) { export async function lockCard(game: string, cardId: string) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/lockCard/${cardId}`, + config.public.endpoint + `/games/${game}/turn/lockCard/${cardId}`, { method: "POST", credentials: "include", @@ -97,7 +97,7 @@ export async function lockCard(game: string, cardId: string) { export async function buyCard(game: string, cardId: string) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/buyCard/${cardId}`, + config.public.endpoint + `/games/${game}/turn/buyCard/${cardId}`, { method: "POST", credentials: "include", @@ -107,7 +107,7 @@ export async function buyCard(game: string, cardId: string) { export async function buyGem(game: string) { const config = useRuntimeConfig(); - await $fetch(config.public.endpoint + `games/${game}/turn/buyGem`, { + await $fetch(config.public.endpoint + `/games/${game}/turn/buyGem`, { method: "POST", credentials: "include", }); @@ -121,7 +121,7 @@ export async function useToken( ) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/useToken/${tokenId}`, + config.public.endpoint + `/games/${game}/turn/useToken/${tokenId}`, { method: "POST", credentials: "include", @@ -133,7 +133,7 @@ export async function useToken( export async function lockEffect(game: string, effectId: string) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/lockEffect/${effectId}`, + config.public.endpoint + `/games/${game}/turn/lockEffect/${effectId}`, { method: "POST", credentials: "include", @@ -148,7 +148,7 @@ export async function makeDiscard( ) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/makeDiscard/${playerId}`, + config.public.endpoint + `/games/${game}/turn/makeDiscard/${playerId}`, { method: "POST", credentials: "include", @@ -163,7 +163,7 @@ export async function damagePlayer( ) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/damagePlayer/${playerId}`, + config.public.endpoint + `/games/${game}/turn/damagePlayer/${playerId}`, { method: "POST", credentials: "include", @@ -179,7 +179,7 @@ export async function damageChampion( ) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/damageChampion/${cardId}`, + config.public.endpoint + `/games/${game}/turn/damageChampion/${cardId}`, { method: "POST", credentials: "include", @@ -191,7 +191,7 @@ export async function damageChampion( export async function discardCard(game: string, cardId: string) { const config = useRuntimeConfig(); await $fetch( - config.public.endpoint + `games/${game}/turn/discardCard/${cardId}`, + config.public.endpoint + `/games/${game}/turn/discardCard/${cardId}`, { method: "POST", credentials: "include",