Add create todo under each channel

Sort channels for consistency
This commit is contained in:
jude committed 2024-04-11 15:32:34 +01:00
1 parent 5406e6b8ec
commit 5e99a6f9de
3 files changed
+20 -32

No files matched your search

+7 -3
View File
@@ -129,9 +129,13 @@ export const fetchGuildInfo = (guild: string) => ({
export const fetchGuildChannels = (guild: string) => ({
queryKey: ["GUILD_CHANNELS", guild],
queryFn: () =>
axios.get(`/dashboard/api/guild/${guild}/channels`).then((resp) => resp.data) as Promise<
ChannelInfo[]
>,
axios
.get(`/dashboard/api/guild/${guild}/channels`)
.then((resp) =>
resp.data.sort((a: ChannelInfo, b: ChannelInfo) =>
a.name == b.name ? 0 : a.name > b.name ? 1 : -1,
),
) as Promise<ChannelInfo[]>,
staleTime: GUILD_INFO_STALE_TIME,
});