feat: implement fetchMe
This commit is contained in:
parent
0ea12e7f00
commit
58fe9a2eac
3 changed files with 13 additions and 3 deletions
|
@ -21,6 +21,10 @@ export const useApi = () => {
|
|||
return ensureIsArray(await fetchWithApi(`/me/guilds`));
|
||||
}
|
||||
|
||||
async function fetchMe(): Promise<UserResponse | undefined> {
|
||||
return await fetchWithApi("/me")
|
||||
}
|
||||
|
||||
async function fetchChannels(guildId: string): Promise<ChannelResponse[]> {
|
||||
return ensureIsArray(await fetchWithApi(`/guilds/${guildId}/channels`));
|
||||
}
|
||||
|
@ -98,6 +102,7 @@ export const useApi = () => {
|
|||
fetchGuilds,
|
||||
fetchGuild,
|
||||
fetchMyGuilds,
|
||||
fetchMe,
|
||||
fetchChannels,
|
||||
fetchChannel,
|
||||
fetchMembers,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue