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));
        }
예제 #2
0
        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());
        }
예제 #3
0
 public Query(CategoryUpdateIn category)
 {
     Category = category;
 }