ソースを参照

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)

読み込み中…
キャンセル
保存