feat: add createChannel function to api composable

This commit is contained in:
SauceyRed 2025-07-13 00:20:06 +02:00
parent a1e21244aa
commit 3c868931e8
Signed by: sauceyred
GPG key ID: 270B096EF6E9A462

View file

@ -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
}
}