SSE on words

This commit is contained in:
2024-12-29 22:06:57 +01:00
parent 29ffc556ec
commit e0ece631d3
8 changed files with 126 additions and 65 deletions
+13
View File
@@ -0,0 +1,13 @@
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
}
-15
View File
@@ -1,15 +0,0 @@
import { UserResponseDTO } from "~/netcode/events/dto/userresponse.dto";
export async function fetchUser(id: string) {
const config = useRuntimeConfig();
const data = await useFetch<UserResponseDTO>(config.public.endpoint + `/users/` + id, {
credentials: "include",
}).then(_d => {
if (_d.data.value) {
_d.data.value = new UserResponseDTO(_d.data.value)
}
return _d
})
return data
}