Skip to content

Commit 262675d

Browse files
committed
Redirect back after saving user details
1 parent f8c662f commit 262675d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Controller/UsersController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ public function edit($id = null)
8787
->firstOrFail();
8888

8989
if ($this->request->is(['patch', 'post', 'put'])) {
90+
// TODO: Upload photo
9091
$user = $this->Users->patchEntity($user, $this->request->getData());
9192
if ($this->Users->save($user)) {
9293
$this->Flash->success(__('The user has been saved.'));
9394

94-
return $this->redirect(['action' => 'index']);
95+
return $this->redirect($this->referer());
9596
}
9697
$this->Flash->error(__('The user could not be saved. Please, try again.'));
9798
}

0 commit comments

Comments
 (0)