feat: implemend fetchMyGuilds() api

This commit is contained in:
Twig 2025-07-16 10:47:03 +02:00
parent 56ccd61107
commit ea1f032ffc
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

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