public async Task <BlogPost> ApproveReject(DTOPostStatus postStatus) { var dbPost = _blogContext.BlogPosts.Find(postStatus.PostId); dbPost.StatusId = postStatus.StatusId; dbPost.ApprovalDate = DateTime.Now; await _blogContext.SaveChangesAsync(); return(dbPost); }
public async Task <BlogPost> Put(int id, DTOPostStatus postStatus) { var updatedPost = await _blogService.ApproveReject(postStatus); return(updatedPost); }