fix: nil slices return [] not null in all API responses
This commit is contained in:
@@ -27,9 +27,6 @@ func (s *Server) listProjects(w http.ResponseWriter, r *http.Request) {
|
||||
respondError(w, http.StatusInternalServerError, "failed to list projects: "+err.Error())
|
||||
return
|
||||
}
|
||||
if projects == nil {
|
||||
projects = []store.Project{}
|
||||
}
|
||||
respondJSON(w, http.StatusOK, projects)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user