🍻 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')) {
|
if ($request->isMethod('post')) {
|
||||||
// TODO filter
|
// TODO filter
|
||||||
$deal
|
$updated_deal = \Shikiryu\LBCReposter\Deal::fromJSON($folder_path . '/data.json');
|
||||||
|
$result =
|
||||||
|
$updated_deal
|
||||||
->setSubject($request->subject)
|
->setSubject($request->subject)
|
||||||
->setBody($request->body)
|
->setBody($request->body)
|
||||||
->setCategory($request->category)
|
->setCategory($request->category)
|
||||||
->setPrice($request->price);
|
->setPrice($request->price)
|
||||||
$deal->save($folder_path);
|
->save($folder_path);
|
||||||
return redirect()->route('deals.list', ['type' => $type])->with('status', ($result ? 'Deal mis à jour': 'ERREUR'));
|
return redirect()->route('deals.list', ['type' => $type])->with('status', ($result ? 'Deal mis à jour': 'ERREUR'));
|
||||||
}
|
}
|
||||||
return view('update', ['deal' => $deal, 'type' => $type]);
|
return view('update', ['deal' => $deal, 'type' => $type]);
|
||||||
|
Loading…
Reference in New Issue
Block a user