Skip to content

Commit 7ec0abc

Browse files
committed
Get tests green
1 parent ec3c243 commit 7ec0abc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coderd/projects.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func (api *api) projects(rw http.ResponseWriter, r *http.Request) {
4242
projects, err := api.Database.GetProjectsByOrganizationIDs(r.Context(), organizationIDs)
4343
if errors.Is(err, sql.ErrNoRows) {
4444
err = nil
45+
projects = []database.Project{}
4546
}
4647
if err != nil {
4748
httpapi.Write(rw, http.StatusInternalServerError, httpapi.Response{
@@ -59,6 +60,7 @@ func (api *api) projectsByOrganization(rw http.ResponseWriter, r *http.Request)
5960
projects, err := api.Database.GetProjectsByOrganizationIDs(r.Context(), []string{organization.ID})
6061
if errors.Is(err, sql.ErrNoRows) {
6162
err = nil
63+
projects = []database.Project{}
6264
}
6365
if err != nil {
6466
httpapi.Write(rw, http.StatusInternalServerError, httpapi.Response{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy