Example #1
0
        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);
        }
Example #2
0
        public async Task <BlogPost> Put(int id, DTOPostStatus postStatus)
        {
            var updatedPost = await _blogService.ApproveReject(postStatus);

            return(updatedPost);
        }