feat: add joinGuild function to api composable
This commit is contained in:
parent
94a37340f6
commit
a1e21244aa
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue