public async Task <ActionResult <ArticleCategoryDTO> > AddArticleCategory(UpdateArticleCategoryRequest createdArticleCategory) { if (!ModelState.IsValid) { return(BadRequest()); } var articleCategory = await articleCategoryService.CreateArticleCategoryAsync(createdArticleCategory); return(CreatedAtAction("GetArticleCategory", new { articleCategoryId = articleCategory.Id }, articleCategory)); }
public async Task <IActionResult> UpdateArticleCategory(int articleCategoryId, UpdateArticleCategoryRequest updatedArticleCategory) { if (!ModelState.IsValid) { return(BadRequest()); } var articleCategory = await articleCategoryService.UpdateArticleCategoryAsync(articleCategoryId, updatedArticleCategory); if (articleCategory == null) { return(NotFound()); } return(NoContent()); }