Error message if the delete fails

This commit is contained in:
José Oliveira 2021-02-08 10:22:07 +00:00 committed by Josh Harvey
parent 4ec49c4966
commit 76b321accd
11 changed files with 111 additions and 43 deletions

View file

@ -41,10 +41,12 @@ const Triggers = () => {
const complianceConfig =
data?.config && fromNamespace('compliance')(data.config)
const rejectAddressReuse = complianceConfig?.rejectAddressReuse ?? false
const [error, setError] = useState(null)
const [saveConfig, { error }] = useMutation(SAVE_CONFIG, {
const [saveConfig] = useMutation(SAVE_CONFIG, {
onCompleted: () => setWizard(false),
refetchQueries: () => ['getData']
refetchQueries: () => ['getData'],
onError: error => setError(error)
})
const add = rawConfig => {
@ -60,6 +62,7 @@ const Triggers = () => {
}
const save = config => {
setError(null)
return saveConfig({
variables: { config: { triggers: toServer(config.triggers) } }
})