mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-18 06:03:02 -04:00
Updates on frontend module
This commit is contained in:
@@ -41,4 +41,35 @@ class SectionController extends Controller
|
||||
'message' => __('frontend::common.store-section-failed'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
public function update(SectionRequest $request)
|
||||
{
|
||||
$result = $this->repository->update($request->id, $request->title, $request->layout);
|
||||
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => __('frontend::common.section-updated'),
|
||||
'section' => $result,
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'message' => __('frontend::common.update-section-failed'),
|
||||
], 400);
|
||||
}
|
||||
|
||||
public function destroy(SectionRequest $request)
|
||||
{
|
||||
$result = $this->repository->destroy($request->id);
|
||||
|
||||
if ($result) {
|
||||
return response()->json([
|
||||
'message' => __('frontend::common.section-deleted'),
|
||||
]);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'message' => __('frontend::common.delete-section-failed'),
|
||||
], 400);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user