mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 18:56:42 +02:00
refactor: harmonize redirects after submitting forms
go back to form after submitting an edit form
This commit is contained in:
parent
6e9451a110
commit
d0cb964b0f
36 changed files with 179 additions and 57 deletions
|
|
@ -124,12 +124,13 @@ class PostController extends Controller
|
|||
'published_at' => Time::now(),
|
||||
]);
|
||||
|
||||
if (! model('PostModel')->addPost($newPost)) {
|
||||
$postModel = model('PostModel');
|
||||
if (! $postModel->addPost($newPost)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
// TODO: translate
|
||||
->with('error', "Couldn't create Post");
|
||||
->with('error', $postModel->errors());
|
||||
}
|
||||
|
||||
// Post without preview card has been successfully created
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue