feat: add createChannel function to api composable
This commit is contained in:
parent
a1e21244aa
commit
3c868931e8
1 changed files with 5 additions and 0 deletions
|
@ -49,6 +49,10 @@ export const useApi = () => {
|
|||
return await fetchWithApi(`/invites/${invite}`, { method: "POST" }) as GuildResponse;
|
||||
}
|
||||
|
||||
async function createChannel(guildId: string, name: string, description?: string): Promise<void> {
|
||||
return await fetchWithApi(`/guilds/${guildId}/channels`, { method: "POST", body: { name, description } });
|
||||
}
|
||||
|
||||
return {
|
||||
fetchGuilds,
|
||||
fetchGuild,
|
||||
|
@ -62,5 +66,6 @@ export const useApi = () => {
|
|||
fetchMessage,
|
||||
createGuild,
|
||||
joinGuild,
|
||||
createChannel
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue