From 83a6313f090e089f70ba63c357df83af1c3a8776 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 25 Sep 2019 02:21:36 -0600 Subject: [PATCH] Add /api/v1/domain_blocks endpoint --- app/Http/Controllers/Api/ApiV1Controller.php | 14 ++++++++++++++ routes/web.php | 3 +++ 2 files changed, 17 insertions(+) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 232f06e8..88853a4e 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -623,6 +623,20 @@ class ApiV1Controller extends Controller return response()->json([]); } + + /** + * GET /api/v1/domain_blocks + * + * Return empty array + * + * @return array + */ + public function accountDomainBlocks(Request $request) + { + abort_if(!$request->user(), 403); + return response()->json([]); + } + public function statusById(Request $request, $id) { $status = Status::whereVisibility('public')->findOrFail($id); diff --git a/routes/web.php b/routes/web.php index 4a5c73d4..d3e5fdbc 100644 --- a/routes/web.php +++ b/routes/web.php @@ -91,6 +91,9 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact // Route::get('accounts/{id}', 'PublicApiController@account'); Route::get('accounts/{id}', 'Api\ApiV1Controller@accountById'); Route::post('avatar/update', 'ApiController@avatarUpdate')->middleware('auth:api'); + Route::get('domain_blocks', 'Api\ApiV1Controller@accountDomainBlocks')->middleware('auth:api'); + Route::post('domain_blocks', 'Api\ApiV1Controller@accountDomainBlocks')->middleware('auth:api'); + Route::delete('domain_blocks', 'Api\ApiV1Controller@accountDomainBlocks')->middleware('auth:api'); Route::get('blocks', 'Api\ApiV1Controller@accountBlocks')->middleware('auth:api'); Route::get('custom_emojis', 'Api\ApiV1Controller@customEmojis'); Route::get('likes', 'ApiController@hydrateLikes');