Skip to content

Deprecate some routes by comments #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- Updated dependency of eslint-config-prettier
[#603](https://github.com./nextcloud/cookbook/pull/603) @christianlupus

## Deprecated
- Obsolete routes to old user interface, see `appinfo/routes.php`
[#580](https://github.com./nextcloud/cookbook/pull/580) @christianlupus

## 0.8.1 - 2021-02-15

### Added
Expand Down
16 changes: 9 additions & 7 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@
*/
['name' => 'main#getApiVersion', 'url' => '/api/version', 'verb' => 'GET'],
['name' => 'main#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'main#home', 'url' => '/home', 'verb' => 'GET'],
['name' => 'main#keywords', 'url' => '/keywords', 'verb' => 'GET'],
['name' => 'main#categories', 'url' => '/categories', 'verb' => 'GET'],
['name' => 'main#error', 'url' => '/error', 'verb' => 'GET'],
['name' => 'main#create', 'url' => '/recipes/create', 'verb' => 'GET'],
['name' => 'main#new', 'url' => '/recipes/create', 'verb' => 'POST'],
['name' => 'main#import', 'url' => '/import', 'verb' => 'POST'],
['name' => 'main#edit', 'url' => '/recipes/{id}/edit', 'verb' => 'GET', 'requirements' => ['id' => '\d+']],
['name' => 'main#update', 'url' => '/recipes/{id}/edit', 'verb' => 'PUT', 'requirements' => ['id' => '\d+']],
['name' => 'main#recipe', 'url' => '/recipes/{id}', 'verb' => 'GET', 'requirements' => ['id' => '\d+']],
['name' => 'recipe#image', 'url' => '/recipes/{id}/image', 'verb' => 'GET', 'requirements' => ['id' => '\d+']],
['name' => 'config#reindex', 'url' => '/reindex', 'verb' => 'POST'],
['name' => 'config#list', 'url' => '/config', 'verb' => 'GET'],
Expand All @@ -35,6 +28,15 @@
['name' => 'main#categoryUpdate', 'url' => '/api/category/{category}', 'verb' => 'PUT'],
['name' => 'main#tags', 'url' => '/api/tags/{keywords}', 'verb' => 'GET'],
['name' => 'main#search', 'url' => '/api/search/{query}', 'verb' => 'GET'],
/* Unknown usage */
/* Deprecated routes */
['name' => 'main#new', 'url' => '/recipes/create', 'verb' => 'POST'],
['name' => 'main#update', 'url' => '/recipes/{id}/edit', 'verb' => 'PUT', 'requirements' => ['id' => '\d+']],
['name' => 'main#home', 'url' => '/home', 'verb' => 'GET'],
['name' => 'main#error', 'url' => '/error', 'verb' => 'GET'],
['name' => 'main#create', 'url' => '/recipes/create', 'verb' => 'GET'],
['name' => 'main#edit', 'url' => '/recipes/{id}/edit', 'verb' => 'GET', 'requirements' => ['id' => '\d+']],
['name' => 'main#recipe', 'url' => '/recipes/{id}', 'verb' => 'GET', 'requirements' => ['id' => '\d+']],
],

/* API resources */
Expand Down
5 changes: 5 additions & 0 deletions lib/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function keywords() {
/**
* @NoAdminRequired
* @NoCSRFRequired
* @deprecated
*/
public function home() {
$this->dbCacheService->triggerCheck();
Expand Down Expand Up @@ -135,6 +136,7 @@ public function home() {
/**
* @NoAdminRequired
* @NoCSRFRequired
* @deprecated
*/
public function error() {
$this->dbCacheService->triggerCheck();
Expand Down Expand Up @@ -286,6 +288,7 @@ public function tags($keywords) {
/**
* @NoAdminRequired
* @NoCSRFRequired
* @deprecated
*/
public function recipe($id) {
$this->dbCacheService->triggerCheck();
Expand Down Expand Up @@ -314,6 +317,7 @@ public function recipe($id) {
/**
* @NoAdminRequired
* @NoCSRFRequired
* @deprecated
*/
public function create() {
$this->dbCacheService->triggerCheck();
Expand Down Expand Up @@ -375,6 +379,7 @@ public function new() {
/**
* @NoAdminRequired
* @NoCSRFRequired
* @deprecated
*/
public function edit($id) {
$this->dbCacheService->triggerCheck();
Expand Down