Преглед изворни кода

Categories controller changed

BE_dev
bronjaermin пре 2 година
родитељ
комит
c7286f2e28
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5
    2
      Diligent.WebAPI.Host/Controllers/V1/CategoriesController.cs

+ 5
- 2
Diligent.WebAPI.Host/Controllers/V1/CategoriesController.cs Прегледај датотеку

@@ -27,8 +27,11 @@ namespace Diligent.WebAPI.Host.Controllers.V1
Ok(await _categoryService.GetCategories(userId));

[HttpGet("all-categories")]
public async Task<IActionResult> GetAllCategories() =>
Ok(await _categoryService.GetAllCategories());
public async Task<IActionResult> GetAllCategories()
{
User? user = (User?)HttpContext.Items["User"];
return Ok(await _categoryService.GetAllCategories(user.Id));
}

[HttpPost]
public async Task<IActionResult> CreateCategory([FromBody] CreateCategoryDto request)

Loading…
Откажи
Сачувај