feat: implemend fetchMyGuilds() api
This commit is contained in:
parent
56ccd61107
commit
ea1f032ffc
2 changed files with 7 additions and 2 deletions
|
@ -17,6 +17,10 @@ export const useApi = () => {
|
|||
return await fetchWithApi(`/guilds/${guildId}`);
|
||||
}
|
||||
|
||||
async function fetchMyGuilds(): Promise<GuildResponse[]> {
|
||||
return ensureIsArray(await fetchWithApi(`/me/guilds`));
|
||||
}
|
||||
|
||||
async function fetchChannels(guildId: string): Promise<ChannelResponse[]> {
|
||||
return ensureIsArray(await fetchWithApi(`/guilds/${guildId}/channels`));
|
||||
}
|
||||
|
@ -85,6 +89,7 @@ export const useApi = () => {
|
|||
return {
|
||||
fetchGuilds,
|
||||
fetchGuild,
|
||||
fetchMyGuilds,
|
||||
fetchChannels,
|
||||
fetchChannel,
|
||||
fetchMembers,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue