diff --git a/composables/api.ts b/composables/api.ts index 0382cfb..0bdea4e 100644 --- a/composables/api.ts +++ b/composables/api.ts @@ -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 { + 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 } }