fix: always show a newly created workspace at the top of the list (#6984)

Fixes #5795.
This commit is contained in:
Kyle Carberry
2023-04-04 08:24:04 -05:00
committed by GitHub
parent 46f42ea9ac
commit c12bc39821
6 changed files with 14 additions and 9 deletions
+3
View File
@@ -480,6 +480,9 @@ func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Req
Name: createWorkspace.Name,
AutostartSchedule: dbAutostartSchedule,
Ttl: dbTTL,
// The workspaces page will sort by last used at, and it's useful to
// have the newly created workspace at the top of the list!
LastUsedAt: database.Now(),
})
if err != nil {
return xerrors.Errorf("insert workspace: %w", err)