From 3c868931e8e7f9f04864f285ff39b86ef41f29c9 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Sun, 13 Jul 2025 00:20:06 +0200 Subject: [PATCH] feat: add createChannel function to api composable --- composables/api.ts | 5 +++++ 1 file changed, 5 insertions(+) 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 } }