Allow removing attachments

Show HTTP errors
This commit is contained in:
jude
2024-03-27 17:19:19 +00:00
parent 334b1bc084
commit 18cac0345b
4 changed files with 43 additions and 2 deletions

View File

@ -18,6 +18,12 @@ export const CreateButtonRow = () => {
const queryClient = useQueryClient();
const mutation = useMutation({
...(guild ? postGuildReminder(guild) : postUserReminder()),
onError: (error) => {
flash({
message: `An error occurred: ${error}`,
type: "error",
});
},
onSuccess: (data) => {
if (data.error) {
flash({

View File

@ -19,6 +19,12 @@ export const EditButtonRow = () => {
const flash = useFlash();
const mutation = useMutation({
...(guild ? patchGuildReminder(guild) : patchUserReminder()),
onError: (error) => {
flash({
message: `An error occurred: ${error}`,
type: "error",
});
},
onSuccess: (response) => {
if (guild) {
queryClient.invalidateQueries({