feat: add createGuild function to api composable
This commit is contained in:
parent
fb452d8a5b
commit
94a37340f6
1 changed files with 6 additions and 1 deletions
|
@ -41,6 +41,10 @@ export const useApi = () => {
|
||||||
return await fetchWithApi(`/channels/${channelId}/messages/${messageId}`);
|
return await fetchWithApi(`/channels/${channelId}/messages/${messageId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function createGuild(name: string): Promise<void> {
|
||||||
|
return await fetchWithApi(`/guilds`, { method: "POST", body: { name } });
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fetchGuilds,
|
fetchGuilds,
|
||||||
fetchGuild,
|
fetchGuild,
|
||||||
|
@ -51,6 +55,7 @@ export const useApi = () => {
|
||||||
fetchUsers,
|
fetchUsers,
|
||||||
fetchUser,
|
fetchUser,
|
||||||
fetchMessages,
|
fetchMessages,
|
||||||
fetchMessage
|
fetchMessage,
|
||||||
|
createGuild,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue