Skip to content

Commit 952b5d3

Browse files
committed
fix: Database fake
1 parent 28b12c8 commit 952b5d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coderd/database/databasefake/databasefake.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ func (q *fakeQuerier) UpdateProvisionerJobWithCompleteByID(_ context.Context, ar
20452045
return sql.ErrNoRows
20462046
}
20472047

2048-
func (q *fakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWorkspaceParams) error {
2048+
func (q *fakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWorkspaceParams) (database.Workspace, error) {
20492049
q.mutex.Lock()
20502050
defer q.mutex.Unlock()
20512051

@@ -2058,17 +2058,17 @@ func (q *fakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWork
20582058
continue
20592059
}
20602060
if other.Name == arg.Name {
2061-
return &pq.Error{Code: "23505", Message: "duplicate key value violates unique constraint"}
2061+
return database.Workspace{}, &pq.Error{Code: "23505", Message: "duplicate key value violates unique constraint"}
20622062
}
20632063
}
20642064

20652065
workspace.Name = arg.Name
20662066
q.workspaces[i] = workspace
20672067

2068-
return nil
2068+
return workspace, nil
20692069
}
20702070

2071-
return sql.ErrNoRows
2071+
return database.Workspace{}, sql.ErrNoRows
20722072
}
20732073

20742074
func (q *fakeQuerier) UpdateWorkspaceAutostart(_ context.Context, arg database.UpdateWorkspaceAutostartParams) error {

0 commit comments

Comments
 (0)