From a1e21244aa4a11069cd4cee38bd74dc9234f6e82 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Sun, 13 Jul 2025 00:18:42 +0200 Subject: [PATCH] feat: add joinGuild function to api composable --- composables/api.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composables/api.ts b/composables/api.ts index 0db1296..0382cfb 100644 --- a/composables/api.ts +++ b/composables/api.ts @@ -45,6 +45,10 @@ export const useApi = () => { return await fetchWithApi(`/guilds`, { method: "POST", body: { name } }); } + async function joinGuild(invite: string): Promise { + return await fetchWithApi(`/invites/${invite}`, { method: "POST" }) as GuildResponse; + } + return { fetchGuilds, fetchGuild, @@ -57,5 +61,6 @@ export const useApi = () => { fetchMessages, fetchMessage, createGuild, + joinGuild, } }