Skip to content
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

Some minor code fixes found at various locations #579

Merged
merged 6 commits into from
Feb 12, 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
11 changes: 2 additions & 9 deletions lib/Controller/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand All @@ -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
]
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchResults.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion templates/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
script('cookbook', 'vue');
style('cookbook', 'style');
?>

<div id="app">
Expand Down