diff --git a/backend/routes/member/get_member.go b/backend/routes/member/get_member.go index 8020c17..1316780 100644 --- a/backend/routes/member/get_member.go +++ b/backend/routes/member/get_member.go @@ -77,6 +77,10 @@ func (s *Server) getMember(w http.ResponseWriter, r *http.Request) error { return err } + if u.DeletedAt != nil { + return server.APIError{Code: server.ErrMemberNotFound} + } + fields, err := s.DB.MemberFields(ctx, m.ID) if err != nil { return err @@ -96,6 +100,10 @@ func (s *Server) getUserMember(w http.ResponseWriter, r *http.Request) error { } } + if u.DeletedAt != nil { + return server.APIError{Code: server.ErrUserNotFound} + } + m, err := s.DB.UserMember(ctx, u.ID, chi.URLParam(r, "memberRef")) if err != nil { return server.APIError{ diff --git a/backend/routes/member/get_members.go b/backend/routes/member/get_members.go index 48814a3..ff7f631 100644 --- a/backend/routes/member/get_members.go +++ b/backend/routes/member/get_members.go @@ -44,6 +44,10 @@ func (s *Server) getUserMembers(w http.ResponseWriter, r *http.Request) error { } } + if u.DeletedAt != nil { + return server.APIError{Code: server.ErrUserNotFound} + } + ms, err := s.DB.UserMembers(ctx, u.ID) if err != nil { return err diff --git a/backend/routes/user/get_user.go b/backend/routes/user/get_user.go index ffbf56b..6a07104 100644 --- a/backend/routes/user/get_user.go +++ b/backend/routes/user/get_user.go @@ -104,6 +104,10 @@ func (s *Server) getUser(w http.ResponseWriter, r *http.Request) error { return err } + if u.DeletedAt != nil { + return server.APIError{Code: server.ErrUserNotFound} + } + fields, err := s.DB.UserFields(ctx, u.ID) if err != nil { log.Errorf("Error getting user fields: %v", err)