Add delete functionality

This commit is contained in:
jude
2023-11-04 17:45:54 +00:00
parent 31b25e3533
commit f8582e1fe9
8 changed files with 371 additions and 222 deletions

View File

@ -129,7 +129,7 @@ export const fetchGuildReminders = (guild: string) => ({
staleTime: OTHER_STALE_TIME,
});
export const mutateGuildReminder = (guild: string) => ({
export const patchGuildReminder = (guild: string) => ({
mutationFn: (reminder: Reminder) =>
axios.patch(`/dashboard/api/guild/${guild}/reminders`, {
...reminder,
@ -137,6 +137,15 @@ export const mutateGuildReminder = (guild: string) => ({
}),
});
export const deleteGuildReminder = (guild: string) => ({
mutationFn: (reminder: Reminder) =>
axios.delete(`/dashboard/api/guild/${guild}/reminders`, {
data: {
uid: reminder.uid,
},
}),
});
export const fetchGuildTemplates = (guild: string) => ({
queryKey: ["GUILD_TEMPLATES", guild],
queryFn: () =>