* Extended functionalities

* Added different UIs
This commit is contained in:
2026-06-24 21:43:40 +02:00
parent 282f4864c4
commit f15bb7a916
348 changed files with 59057 additions and 498 deletions

View File

@@ -14,12 +14,16 @@ public class RecipesController : ControllerBase
public RecipesController(IRecipeService recipeService) => _recipeService = recipeService;
/// <summary>Lists active recipes, optionally filtered by category and/or name search.</summary>
/// <summary>
/// Lists active recipes, optionally filtered by category, recipe-name search,
/// and/or an ingredient name (returns recipes that contain that ingredient).
/// </summary>
[HttpGet]
[ProducesResponseType(typeof(IReadOnlyList<RecipeListItemDto>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetRecipes(
[FromQuery] int? category,
[FromQuery] string? search,
[FromQuery] string? ingredient,
CancellationToken ct)
{
if (category is < 0 or > 3)
@@ -27,7 +31,7 @@ public class RecipesController : ControllerBase
return BadRequest(new { error = "category must be between 0 and 3." });
}
var recipes = await _recipeService.GetRecipesAsync(category, search, ct);
var recipes = await _recipeService.GetRecipesAsync(category, search, ingredient, ct);
return Ok(recipes);
}