Added order and status to section manager

This commit is contained in:
Fritz Ramirez
2024-03-25 16:44:14 +08:00
parent 95b0ef0b28
commit 6310984a0f
14 changed files with 202 additions and 21 deletions
@@ -41,7 +41,7 @@ class SectionController extends Controller
public function store(SectionRequest $request)
{
$section = $this->repository->create($request->title, $request->layout);
$section = $this->repository->create($request->title, $request->layout, $request->order);
if ($section) {
return response()->json([
@@ -57,7 +57,7 @@ class SectionController extends Controller
public function update(SectionRequest $request)
{
$result = $this->repository->update($request->id, $request->title, $request->layout);
$result = $this->repository->update($request->id, $request->title, $request->layout, $request->order);
if ($result) {
return response()->json([
@@ -115,4 +115,13 @@ class SectionController extends Controller
'message' => __('frontend::common.section-translations-updated'),
]);
}
public function updateSectionStatus(Request $request, Section $section)
{
$this->service->updateSectionStatus($section, $request->state);
return response()->json([
'message' => __('frontend::common.section-status-updated'),
]);
}
}