fix(BE): show controller
This commit is contained in:
parent
7b2497e392
commit
377f1b6624
2 changed files with 15 additions and 8 deletions
|
@ -42,16 +42,17 @@ class ShowController extends Controller
|
|||
public function store(Request $request)
|
||||
{
|
||||
try {
|
||||
$showInfos = $request->show;
|
||||
$showDaysRules = $request->showDaysRules;
|
||||
$showDjs = $request->showDjs;
|
||||
$show = Show::firstOrCreate($showInfos);
|
||||
$this->manageShowDays($show, $showDaysRules);
|
||||
$this->manageShowDjs($showDjs, $show);
|
||||
}catch(Exception $e){
|
||||
$showData = $request->all();
|
||||
$showDays = $showData['show_days'];
|
||||
$showDJs = $showData['show_djs'];
|
||||
$this->createShow($showData, $showDays, $showDJs);
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
'message' => 'Show saved successfully!'
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['message' => $e->getMessage()], 500);
|
||||
}
|
||||
return response()->json(['message' => 'Show created successfully']);
|
||||
}
|
||||
|
||||
public function show(ShowResource $show)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue