forked from projects/fipamo
ro
ac543f3856
page editor was missing soft delete of page as it had not been wired up to the new api yet. oops
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Interfaces\PageRepositoryInterface;
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
|
|
class PageAPIController extends Controller
|
|
{
|
|
protected $pages;
|
|
|
|
public function __construct(
|
|
PageRepositoryInterface $pageRepository
|
|
) {
|
|
$this->pages = $pageRepository;
|
|
}
|
|
|
|
public function write(Request $request)
|
|
{
|
|
$body = json_decode($request->getContent());
|
|
$result = $this->pages->update($body);
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
}
|
|
|
|
public function create(Request $request)
|
|
{
|
|
$body = json_decode($request->getContent());
|
|
$result = $this->pages->create($body);
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
}
|
|
|
|
public function delete(Request $request)
|
|
{
|
|
$body = json_decode($request->getContent());
|
|
$result = $this->pages->delete($body);
|
|
return response()->json($result)->header('Content-Type', 'application/json');
|
|
}
|
|
}
|