Skip to content

Commit

Permalink
fix #time 5m #comment fixing error handling on blog services
Browse files Browse the repository at this point in the history
  • Loading branch information
PickHD committed May 2, 2022
1 parent b56fda3 commit 9e526ae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions service/blog.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ func (bs *BlogService) UpdateBlogSvc(id int, req model.UpdateBlogRequest, update
if err == pgx.ErrNoRows {
return model.ErrBlogNotFound
}

return err
}

blogMap,err := validateUpdateBlogRequest(currentBlog,&req)
Expand All @@ -216,6 +218,8 @@ func (bs *BlogService) DeleteBlogSvc(id int,userID int) error {
if err == pgx.ErrNoRows {
return model.ErrBlogNotFound
}

return err
}

if currentBlog.UserID != userID {
Expand Down

0 comments on commit 9e526ae

Please sign in to comment.