🍻 Remet en place la logique de maj
This commit is contained in:
parent
c52a163a55
commit
eda18e25e8
@ -58,12 +58,14 @@ class HomeController extends Controller
|
||||
}
|
||||
if ($request->isMethod('post')) {
|
||||
// TODO filter
|
||||
$deal
|
||||
->setSubject($request->subject)
|
||||
->setBody($request->body)
|
||||
->setCategory($request->category)
|
||||
->setPrice($request->price);
|
||||
$deal->save($folder_path);
|
||||
$updated_deal = \Shikiryu\LBCReposter\Deal::fromJSON($folder_path . '/data.json');
|
||||
$result =
|
||||
$updated_deal
|
||||
->setSubject($request->subject)
|
||||
->setBody($request->body)
|
||||
->setCategory($request->category)
|
||||
->setPrice($request->price)
|
||||
->save($folder_path);
|
||||
return redirect()->route('deals.list', ['type' => $type])->with('status', ($result ? 'Deal mis à jour': 'ERREUR'));
|
||||
}
|
||||
return view('update', ['deal' => $deal, 'type' => $type]);
|
||||
|
Loading…
Reference in New Issue
Block a user