Skip to content
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 @@ -19,6 +19,8 @@
[#2003](https://github.com/nextcloud/cookbook/pull/2003) @j0hannesr0th
- Fix yield not set calculation error
[#2099](https://github.com/nextcloud/cookbook/pull/2099) @j0hannesr0th
- Output correct stubs for tags, search and categories in the API
[#2270](https://github.com/nextcloud/cookbook/pull/2270) @christianlupus

### Documentation
- Improve structure of `README.md`
Expand Down
6 changes: 6 additions & 0 deletions lib/Controller/Implementation/RecipeImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ public function search($query) {
'size' => 'thumb16'
]
);

$recipes[$i] = $this->stubFilter->apply($recipes[$i]);
}

return new JSONResponse($recipes, 200, ['Content-Type' => 'application/json']);
Expand Down Expand Up @@ -316,6 +318,8 @@ public function getAllInCategory($category) {
'size' => 'thumb16'
]
);

$recipes[$i] = $this->stubFilter->apply($recipes[$i]);
}

return new JSONResponse($recipes, Http::STATUS_OK, ['Content-Type' => 'application/json']);
Expand Down Expand Up @@ -356,6 +360,8 @@ public function getAllWithTags($keywords) {
'size' => 'thumb16'
]
);

$recipes[$i] = $this->stubFilter->apply($recipes[$i]);
}

return new JSONResponse($recipes, Http::STATUS_OK, ['Content-Type' => 'application/json']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ public function testCategory($cat, $recipes): void {
$this->ensureCacheCheckTriggered();

$this->recipeService->method('getRecipesByCategory')->with($cat)->willReturn($recipes);
$this->stubFilter->method('apply')->willReturnArgument(0);

$expected = $this->getExpectedRecipes($recipes);

Expand Down Expand Up @@ -263,6 +264,7 @@ public function testTags($keywords, $recipes): void {
$this->ensureCacheCheckTriggered();

$this->recipeService->method('getRecipesByKeywords')->with($keywords)->willReturn($recipes);
$this->stubFilter->method('apply')->willReturnArgument(0);

$expected = $this->getExpectedRecipes($recipes);

Expand Down Expand Up @@ -336,6 +338,7 @@ public function testSearch($query, $recipes): void {
$this->ensureCacheCheckTriggered();

$this->recipeService->expects($this->once())->method('findRecipesInSearchIndex')->with($query)->willReturn($recipes);
$this->stubFilter->method('apply')->willReturnArgument(0);

$expected = $this->getExpectedRecipes($recipes);

Expand Down