Add server emoji picker

This commit is contained in:
jude
2024-03-31 12:49:52 +01:00
parent 2861cdda0b
commit b0f932445c
6 changed files with 114 additions and 4 deletions

View File

@ -59,6 +59,11 @@ type RoleInfo = {
name: string;
};
type EmojiInfo = {
fmt: string;
name: string;
};
type Template = {
id: number;
name: string;
@ -125,6 +130,15 @@ export const fetchGuildRoles = (guild: string) => ({
staleTime: GUILD_INFO_STALE_TIME,
});
export const fetchGuildEmojis = (guild: string) => ({
queryKey: ["GUILD_EMOJIS", guild],
queryFn: () =>
axios.get(`/dashboard/api/guild/${guild}/emojis`).then((resp) => resp.data) as Promise<
EmojiInfo[]
>,
staleTime: GUILD_INFO_STALE_TIME,
});
export const fetchGuildReminders = (guild: string) => ({
queryKey: ["GUILD_REMINDERS", guild],
queryFn: () =>