mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-17 21:03:00 -04:00
Updated frontend module
This commit is contained in:
@@ -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'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user