public async Task <IActionResult> Put( [FromHeader(Name = "Authorization")] string token, [FromBody] CategoryUpdateIn category) { var userId = User.Claims.GetUserId(); category.UserId = userId; var results = await mediator.Send(new UpdateCategory.Query(category)).ConfigureAwait(false); return(Ok(results)); }
public IActionResult UpdateCategory(string id, CategoryUpdateIn categoryIn) { var category = categoryService.GetCategory(id); if (category == null) { return(NotFound()); } category.Parse(categoryIn); categoryService.UpdateCategory(id, category); return(Ok()); }
public Query(CategoryUpdateIn category) { Category = category; }