From 94a37340f61754e90f5c1423b5cf5be1e2384ddf Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Sun, 13 Jul 2025 00:17:51 +0200 Subject: [PATCH] feat: add createGuild function to api composable --- composables/api.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composables/api.ts b/composables/api.ts index 603f71f..0db1296 100644 --- a/composables/api.ts +++ b/composables/api.ts @@ -41,6 +41,10 @@ export const useApi = () => { return await fetchWithApi(`/channels/${channelId}/messages/${messageId}`); } + async function createGuild(name: string): Promise { + return await fetchWithApi(`/guilds`, { method: "POST", body: { name } }); + } + return { fetchGuilds, fetchGuild, @@ -51,6 +55,7 @@ export const useApi = () => { fetchUsers, fetchUser, fetchMessages, - fetchMessage + fetchMessage, + createGuild, } }