Commit 1cf1aaab authored by Mingsong Hu's avatar Mingsong Hu

Rollback the update if an event was not updated successfully

parent fa305524
......@@ -137,7 +137,10 @@
}
)
.done(function(data) {
// alert("Response: " + data);
if (data !== '1') {
alert("Error: " + data);
info.revert();
}
});
}
}
......@@ -255,7 +258,10 @@
}
)
.done(function(data) {
// alert("Response: " + data);
if (data !== '1') {
alert("Error: " + data);
info.revert();
}
});
}
......
......@@ -208,11 +208,8 @@ class CalendarEventController extends ControllerBase {
'%entity_type' => $entity->getType(),
'%title' => $entity->getTitle(),
]);
return new Response($this->t('%title is updated to from %start to %end', [
'%title' => $entity->getTitle(),
'%start' => $start_date,
'%end' => $end_date,
]));
// Returen 1 as success.
return new Response(1);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment