Skip to content
Snippets Groups Projects
Commit d99af4d1 authored by Daniel Bucher's avatar Daniel Bucher
Browse files

Merge branch 'fix-admin-save-failed' into 'master'

fix trip infos save button resulting in failure notifications

Closes #26

See merge request !9
parents 2d84a395 3aaf6f38
No related branches found
No related tags found
1 merge request!9fix trip infos save button resulting in failure notifications
......@@ -79,9 +79,9 @@ class Fahrt {
public function save() {
if ($this->environment->isSuperAdmin() and $this->newFahrt) {
return $this->environment->database->insert('fahrten', $this->data)->fetchAll();
return $this->environment->database->insert('fahrten', $this->data)->rowCount() > 0;
} elseif ($this->environment->isAdmin() and !$this->newFahrt) {
return $this->environment->database->update('fahrten', $this->data, ['fahrt_id' => $this->fid])->fetchAll();
return $this->environment->database->update('fahrten', $this->data, ['fahrt_id' => $this->fid])->rowCount() > 0;
} else {
throw new Exception('Nicht erlaubt!');
}
......@@ -248,4 +248,4 @@ class Fahrt {
$state = $this->getRegistrationState();
return $state == Fahrt::STATUS_IS_OPEN_FULL or $state == Fahrt::STATUS_IS_OPEN_NOT_FULL;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment