Skip to content

Commit

Permalink
Update ApiV1Controller, add trends endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Mar 25, 2022
1 parent 8c65d60 commit d40a845
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/Http/Controllers/Api/ApiV1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2696,8 +2696,7 @@ public function discoverAccountsPopular(Request $request)
return $this->json($ids);
}


/**
/**
* GET /api/v1/preferences
*
*
Expand All @@ -2717,4 +2716,17 @@ public function getPreferences(Request $request)
'reading:expand:spoilers' => false
]);
}

/**
* GET /api/v1/trends
*
*
* @return array
*/
public function getTrends(Request $request)
{
abort_if(!$request->user(), 403);

return $this->json([]);
}
}
1 change: 1 addition & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
Route::get('discover/posts', 'Api\ApiV1Controller@discoverPosts')->middleware($middleware);

Route::get('preferences', 'Api\ApiV1Controller@getPreferences')->middleware($middleware);
Route::get('trends', 'Api\ApiV1Controller@getTrends')->middleware($middleware);
});

Route::group(['prefix' => 'v2'], function() use($middleware) {
Expand Down

0 comments on commit d40a845

Please sign in to comment.