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 } });
|
||||
}
|
||||
|
||||
async function joinGuild(invite: string): Promise<GuildResponse> {
|
||||
return await fetchWithApi(`/invites/${invite}`, { method: "POST" }) as GuildResponse;
|
||||
}
|
||||
|
||||
return {
|
||||
fetchGuilds,
|
||||
fetchGuild,
|
||||
|
@ -57,5 +61,6 @@ export const useApi = () => {
|
|||
fetchMessages,
|
||||
fetchMessage,
|
||||
createGuild,
|
||||
joinGuild,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue