forked from projects/fipamo
ro
7024285b70
the first part of the page editing API is working again after porting it over form the old fipamo build. a few changes where made to make the code a big more managable, but the end to end process works for updating pages. the remaining page editing methods will be activated after the rendering engine is in place because that's going to be a pretty siginficant effort. but this is a big step.
26 lines
605 B
PHP
26 lines
605 B
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');
|
|
}
|
|
}
|