Update counter only on success
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -144,8 +144,10 @@ export default function TaskFormDialog(props: Props) {
|
||||
},
|
||||
connections: [props.connection!],
|
||||
},
|
||||
onCompleted: () => {
|
||||
updateStoreCounter(relayEnv, data.measureId, "tasks(first:0)", 1);
|
||||
onCompleted: (_response, errors) => {
|
||||
if (!errors) {
|
||||
updateStoreCounter(relayEnv, data.measureId, "tasks(first:0)", 1);
|
||||
}
|
||||
},
|
||||
});
|
||||
reset();
|
||||
|
||||
@@ -165,8 +165,8 @@ function TaskRow(props: TaskRowProps) {
|
||||
input: { taskId: props.task.id },
|
||||
connections: [props.connectionId],
|
||||
},
|
||||
onCompleted: () => {
|
||||
if (params.measureId) {
|
||||
onCompleted: (_response, errors) => {
|
||||
if (!errors && params.measureId) {
|
||||
updateStoreCounter(
|
||||
relayEnv,
|
||||
params.measureId,
|
||||
|
||||
Reference in New Issue
Block a user