Add bookmarks via micropub

This commit is contained in:
Jonny Barnes 2017-10-12 18:33:08 +01:00
parent f16034d963
commit a5d3ba7829
2 changed files with 61 additions and 0 deletions

View file

@ -82,6 +82,14 @@ class MicropubController extends Controller
'location' => config('app.url') . "/likes/$like->id",
], 201)->header('Location', config('app.url') . "/likes/$like->id");
}
if ($request->has('properties.bookmark-of') || $request->has('bookmark-of')) {
$bookmark = (new BookmarkService())->createBookmark($request);
return response()->json([
'response' => 'created',
'location' => config('app.url') . "/bookmarks/$bookmark->id",
], 201)->header('Location', config('app.url') . "/bookmarks/$bookmark->id");
}
$data = [];
$data['client-id'] = $tokenData->getClaim('client_id');
if ($request->header('Content-Type') == 'application/json') {