SyncruleController: base logic on SyncRule
This commit is contained in:
parent
676b5b5efe
commit
7bb55fadbd
|
@ -25,8 +25,9 @@ class SyncruleController extends ActionController
|
||||||
public function runAction()
|
public function runAction()
|
||||||
{
|
{
|
||||||
$id = $this->params->get('id');
|
$id = $this->params->get('id');
|
||||||
$sync = new Sync(SyncRule::load($id, $this->db()));
|
$rule = SyncRule::load($id, $this->db());
|
||||||
if ($runId = $sync->apply()) {
|
if ($rule->applyChanges()) {
|
||||||
|
$runId = $rule->getCurrentSyncRunId();
|
||||||
Notification::success('Source has successfully been synchronized');
|
Notification::success('Source has successfully been synchronized');
|
||||||
$this->redirectNow(
|
$this->redirectNow(
|
||||||
Url::fromPath(
|
Url::fromPath(
|
||||||
|
@ -38,6 +39,8 @@ class SyncruleController extends ActionController
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Notification::error('Synchronization failed');
|
||||||
|
$this->redirectNow('director/list/syncrule');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue