Add delete functionality
This commit is contained in:
11
src/api.ts
11
src/api.ts
@ -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: () =>
|
||||
|
Reference in New Issue
Block a user