diff --git a/CHANGELOG.md b/CHANGELOG.md index 94228bace..d50bd0391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ [#574](https://github.com/nextcloud/cookbook/pull/574) @christianlupus - Enhanced the CI scripts to be more verbose regarding issues [#452](https://github.com/nextcloud/cookbook/pull/452) @christianlupus +- Code cleanup + [#579](https://github.com/nextcloud/cookbook/pull/579) @christianlupus ### Removed - Removal of old contoller no longer in use diff --git a/appinfo/routes.php b/appinfo/routes.php index f7224ec56..06dfc9f03 100755 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -9,6 +9,11 @@ */ return [ 'routes' => [ + /* + * Very important: Do not change anything here without updating the api version in MainController. + * If you add new features here, invrese the minor version of the API. + * If you change the behavior or remove functionality, increase the major version there. + */ ['name' => 'main#getApiVersion', 'url' => '/api/version', 'verb' => 'GET'], ['name' => 'main#index', 'url' => '/', 'verb' => 'GET'], ['name' => 'main#home', 'url' => '/home', 'verb' => 'GET'], diff --git a/lib/Controller/MainController.php b/lib/Controller/MainController.php index 7178f552e..d39bc898f 100755 --- a/lib/Controller/MainController.php +++ b/lib/Controller/MainController.php @@ -51,16 +51,8 @@ public function __construct(string $AppName, IRequest $request, RecipeService $r */ public function index(): TemplateResponse { $this->dbCacheService->triggerCheck(); - - $view_data = [ - 'all_keywords' => $this->service->getAllKeywordsInSearchIndex(), - 'folder' => $this->service->getUserFolderPath(), - 'update_interval' => $this->dbCacheService->getSearchIndexUpdateInterval(), - 'last_update' => $this->dbCacheService->getSearchIndexLastUpdateTime(), - 'print_image' => $this->service->getPrintImage(), - ]; - return new TemplateResponse($this->appName, 'index', $view_data); // templates/index.php + return new TemplateResponse($this->appName, 'index'); // templates/index.php } /** @@ -72,6 +64,7 @@ public function getApiVersion(): DataResponse { $response = [ 'cookbook_version' => [0, 7, 10], /* VERSION_TAG do not change this line manually */ 'api_version' => [ + 'epoch' => 0, 'major' => 0, 'minor' => 2 ] diff --git a/src/components/SearchResults.vue b/src/components/SearchResults.vue index 847afdd9a..74876ae35 100644 --- a/src/components/SearchResults.vue +++ b/src/components/SearchResults.vue @@ -59,7 +59,7 @@ export default { }) .catch(function (e) { $this.results = [] - alert(t('cookbook', 'Failed to load category '+cat+' recipes')) + alert(t('cookbook', 'Failed to load category {category} recipes', {"category": cat})) if (e && e instanceof Error) { throw e } diff --git a/templates/index.php b/templates/index.php index 74bba7c43..bc1404f7d 100755 --- a/templates/index.php +++ b/templates/index.php @@ -1,6 +1,5 @@