diff options
| author | Paweł Bernaciak <pawelbernaciak@zohomail.eu> | 2023-10-25 20:28:34 +0200 |
|---|---|---|
| committer | Paweł Bernaciak <pawelbernaciak@zohomail.eu> | 2023-10-25 20:28:34 +0200 |
| commit | 2e86ace4593d32a2cb1a4be9a758911ff25e4a89 (patch) | |
| tree | 33582ae0ef03f6a1556f950a43004bba6c1ee0f2 /backend/Elements.Backend/Controllers/ElementController.cs | |
| parent | 68e4282555a55f429320b80f09f609970dc76e92 (diff) | |
Model fixes
Diffstat (limited to 'backend/Elements.Backend/Controllers/ElementController.cs')
| -rw-r--r-- | backend/Elements.Backend/Controllers/ElementController.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/Elements.Backend/Controllers/ElementController.cs b/backend/Elements.Backend/Controllers/ElementController.cs index 890f614..2f57514 100644 --- a/backend/Elements.Backend/Controllers/ElementController.cs +++ b/backend/Elements.Backend/Controllers/ElementController.cs @@ -51,13 +51,13 @@ public class ElementController : ControllerBase if (!firstExists || !secondExists) return BadRequest(); - Recipe? recipe = await _dbContext.Recipes.Include(r => r.Result).FirstOrDefaultAsync(r => - (r.FirstIngredient.Id == firstElementId && r.SecondIngredient.Id == secondElementId) || - (r.FirstIngredient.Id == secondElementId && r.SecondIngredient.Id == firstElementId)); + Recipe? recipe = await _dbContext.Recipes.Include(r => r.ResultElement).FirstOrDefaultAsync(r => + (r.FirstElementId == firstElementId && r.SecondElementId == secondElementId) || + (r.FirstElementId == secondElementId && r.SecondElementId == firstElementId)); if (recipe == null) return NotFound(); var serializeOptions = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - return Ok(JsonSerializer.Serialize(recipe.Result, serializeOptions)); + return Ok(JsonSerializer.Serialize(recipe.ResultElement, serializeOptions)); } }
\ No newline at end of file |
