feat: add joinGuild function to api composable

This commit is contained in:
SauceyRed 2025-07-13 00:18:42 +02:00
parent 94a37340f6
commit a1e21244aa
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462

View file

@ -45,6 +45,10 @@ export const useApi = () => {
return await fetchWithApi(`/guilds`, { method: "POST", body: { name } }); return await fetchWithApi(`/guilds`, { method: "POST", body: { name } });
} }
async function joinGuild(invite: string): Promise<GuildResponse> {
return await fetchWithApi(`/invites/${invite}`, { method: "POST" }) as GuildResponse;
}
return { return {
fetchGuilds, fetchGuilds,
fetchGuild, fetchGuild,
@ -57,5 +61,6 @@ export const useApi = () => {
fetchMessages, fetchMessages,
fetchMessage, fetchMessage,
createGuild, createGuild,
joinGuild,
} }
} }