Skip to content

Commit

Permalink
Merge pull request #34 from Mike-Kimani/fix/get_user_from_cookie
Browse files Browse the repository at this point in the history
Add return in get user error handling
  • Loading branch information
kimanimichael authored Jul 9, 2024
2 parents 4583d41 + 4b66a15 commit ce65fbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions handler_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func (apiCfg *apiConfig) handlerGetUserFromCookie(w http.ResponseWriter, r *http
user, err := apiCfg.DB.GetUserByID(r.Context(), userID)
if err != nil {
respondWithError(w, 404, fmt.Sprintf("User not found: %v", err))
return
}
respondWithJSON(w, 200, databaseUserToUser(user))
}
Expand Down

0 comments on commit ce65fbe

Please sign in to comment.