Template
14 lines
331 B
TypeScript
14 lines
331 B
TypeScript
import type { GameResponseDTO } from "~/netcode/events/dto/gameresponse.dto";
|
|
|
|
export async function getGames() {
|
|
const config = useRuntimeConfig();
|
|
const data = await useFetch<GameResponseDTO[]>(
|
|
config.public.endpoint + `/games`,
|
|
{
|
|
credentials: "include",
|
|
immediate: true,
|
|
}
|
|
);
|
|
return data.data
|
|
}
|