Updated frontend module

This commit is contained in:
Fritz Ramirez
2024-02-26 16:50:10 +08:00
parent 06184501ee
commit 60c1965725
22 changed files with 423 additions and 189 deletions
@@ -5,21 +5,25 @@ namespace Modules\Frontend\Http\Controllers;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Modules\Frontend\Entities\Section;
use Modules\Frontend\Http\Requests\SectionRequest;
use Modules\Frontend\Repositories\SectionRepository;
use Modules\Frontend\Services\Sections;
class SectionController extends Controller
{
protected $repository;
protected $service;
public function __construct()
{
$this->repository = new SectionRepository();
$this->service = new Sections();
}
public function index()
{
$sections = $this->repository->all();
$sections = $this->service->all();
return response()->json([
'sections' => $sections,
@@ -72,4 +76,14 @@ class SectionController extends Controller
'message' => __('frontend::common.delete-section-failed'),
], 400);
}
public function updateSectionItems(Request $request, Section $section)
{
$sections = $request->items;
$this->service->updateSectionItems($section, $sections);
return response()->json([
'message' => __('frontend::common.featured-creators-updated'),
]);
}
}