From 2d99434e2b3a67403bc09b12596fde4ed24cf018 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 3 Sep 2021 22:26:39 -0600 Subject: [PATCH] Update web routes --- routes/api.php | 12 +----------- routes/web.php | 32 ++++++++++++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/routes/api.php b/routes/api.php index 9251f32e3..58ccf8952 100644 --- a/routes/api.php +++ b/routes/api.php @@ -75,17 +75,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) { Route::get('timelines/public', 'Api\ApiV1Controller@timelinePublic')->middleware($middleware); Route::get('timelines/tag/{hashtag}', 'Api\ApiV1Controller@timelineHashtag'); }); - Route::group(['prefix' => 'stories'], function () use($middleware) { - Route::get('v1/me', 'StoryController@apiV1Me'); - Route::get('v1/recent', 'StoryController@apiV1Recent'); - Route::post('v1/add', 'StoryController@apiV1Add')->middleware(array_merge($middleware, ['throttle:maxStoriesPerDay,1440'])); - Route::get('v1/item/{id}', 'StoryController@apiV1Item'); - Route::get('v1/fetch/{id}', 'StoryController@apiV1Fetch'); - Route::get('v1/profile/{id}', 'StoryController@apiV1Profile'); - Route::get('v1/exists/{id}', 'StoryController@apiV1Exists'); - Route::delete('v1/delete/{id}', 'StoryController@apiV1Delete')->middleware(array_merge($middleware, ['throttle:maxStoryDeletePerDay,1440'])); - Route::post('v1/viewed', 'StoryController@apiV1Viewed'); - }); + Route::group(['prefix' => 'v2'], function() use($middleware) { Route::get('search', 'Api\ApiV1Controller@searchV2')->middleware($middleware); }); diff --git a/routes/web.php b/routes/web.php index 688d5cfe5..aa4c151d7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -233,17 +233,24 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::group(['prefix' => 'admin'], function () { Route::post('moderate', 'Api\AdminApiController@moderate'); }); - // Route::group(['prefix' => 'stories'], function () { - // Route::get('v0/recent', 'StoryController@apiV1Recent'); - // Route::post('v0/add', 'StoryController@apiV1Add'); - // Route::get('v0/fetch/{id}', 'StoryController@apiV1Fetch'); - // Route::get('v0/profile/{id}', 'StoryController@apiV1Profile'); - // Route::get('v0/exists/{id}', 'StoryController@apiV1Exists'); - // Route::delete('v0/delete/{id}', 'StoryController@apiV1Delete'); - // Route::get('v0/item/{id}', 'StoryController@apiV1Item'); - // Route::post('v0/crop', 'StoryController@cropPhoto'); - // Route::post('v0/publish', 'StoryController@publishStory'); - // }); + + Route::group(['prefix' => 'web/stories'], function () { + Route::get('v1/recent', 'StoryController@recent'); + Route::get('v1/viewers', 'StoryController@viewers'); + Route::get('v1/profile/{id}', 'StoryController@profile'); + Route::get('v1/exists/{id}', 'StoryController@exists'); + Route::get('v1/poll/results', 'StoryController@pollResults'); + Route::post('v1/viewed', 'StoryController@viewed'); + Route::post('v1/react', 'StoryController@react'); + Route::post('v1/comment', 'StoryController@comment'); + Route::post('v1/publish/poll', 'StoryController@publishStoryPoll'); + Route::post('v1/poll/vote', 'StoryController@storyPollVote'); + Route::post('v1/report', 'StoryController@storeReport'); + Route::post('v1/add', 'StoryController@apiV1Add'); + Route::post('v1/crop', 'StoryController@cropPhoto'); + Route::post('v1/publish', 'StoryController@publishStory'); + Route::delete('v1/delete/{id}', 'StoryController@apiV1Delete'); + }); }); @@ -304,7 +311,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::get('me', 'ProfileController@meRedirect'); Route::get('intent/follow', 'SiteController@followIntent'); - Route::post('stories/viewed', 'StoryController@apiV1Viewed'); + Route::get('rs/{id}', 'StoryController@remoteStory'); Route::get('stories/new', 'StoryController@compose'); Route::get('my/story', 'StoryController@iRedirect'); Route::get('web/profile/_/{id}', 'InternalApiController@remoteProfile'); @@ -498,6 +505,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact Route::get('{username}', 'ProfileController@permalinkRedirect'); }); + Route::get('/stories/{username}/{id}', 'StoryController@getActivityObject'); Route::get('stories/{username}', 'ProfileController@stories'); Route::get('p/{id}', 'StatusController@shortcodeRedirect'); Route::get('c/{collection}', 'CollectionController@show');