Allow removing attachments
Show HTTP errors
This commit is contained in:
@ -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({
|
||||
|
@ -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({
|
||||
|
Reference in New Issue
Block a user