Skip to content

Commit 7ce1b3b

Browse files
committed
fix: Database fake
1 parent 0455b67 commit 7ce1b3b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coderd/database/databasefake/databasefake.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,7 +2091,7 @@ func (q *fakeQuerier) UpdateProvisionerJobWithCompleteByID(_ context.Context, ar
20912091
return sql.ErrNoRows
20922092
}
20932093

2094-
func (q *fakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWorkspaceParams) error {
2094+
func (q *fakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWorkspaceParams) (database.Workspace, error) {
20952095
q.mutex.Lock()
20962096
defer q.mutex.Unlock()
20972097

@@ -2104,17 +2104,17 @@ func (q *fakeQuerier) UpdateWorkspace(_ context.Context, arg database.UpdateWork
21042104
continue
21052105
}
21062106
if other.Name == arg.Name {
2107-
return &pq.Error{Code: "23505", Message: "duplicate key value violates unique constraint"}
2107+
return database.Workspace{}, &pq.Error{Code: "23505", Message: "duplicate key value violates unique constraint"}
21082108
}
21092109
}
21102110

21112111
workspace.Name = arg.Name
21122112
q.workspaces[i] = workspace
21132113

2114-
return nil
2114+
return workspace, nil
21152115
}
21162116

2117-
return sql.ErrNoRows
2117+
return database.Workspace{}, sql.ErrNoRows
21182118
}
21192119

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

0 commit comments

Comments
 (0)