fix: refetch cassetes data to avoid resetting to the initial value on UI
when canceling edit
This commit is contained in:
parent
d6d7984a4a
commit
a6bb503b95
1 changed files with 2 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ const ValidationSchema = Yup.object().shape({
|
||||||
})
|
})
|
||||||
|
|
||||||
const GET_MACHINES_AND_CONFIG = gql`
|
const GET_MACHINES_AND_CONFIG = gql`
|
||||||
{
|
query getData {
|
||||||
machines {
|
machines {
|
||||||
name
|
name
|
||||||
id: deviceId
|
id: deviceId
|
||||||
|
|
@ -66,6 +66,7 @@ const CashCassettes = () => {
|
||||||
const { data } = useQuery(GET_MACHINES_AND_CONFIG)
|
const { data } = useQuery(GET_MACHINES_AND_CONFIG)
|
||||||
|
|
||||||
const [resetCashOut] = useMutation(RESET_CASHOUT_BILLS, {
|
const [resetCashOut] = useMutation(RESET_CASHOUT_BILLS, {
|
||||||
|
refetchQueries: () => ['getData'],
|
||||||
onError: ({ graphQLErrors, message }) => {
|
onError: ({ graphQLErrors, message }) => {
|
||||||
const errorMessage = graphQLErrors[0] ? graphQLErrors[0].message : message
|
const errorMessage = graphQLErrors[0] ? graphQLErrors[0].message : message
|
||||||
// TODO new-admin : this should not be final
|
// TODO new-admin : this should not be final
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue