This commit is contained in:
+12
-12
@@ -56,7 +56,7 @@ export async function createGame() {
|
||||
export async function startGame(game: string) {
|
||||
const config = useRuntimeConfig();
|
||||
const res = await $fetch<Game>(
|
||||
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<Game>(
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user