fix: Sort workspace by name by created_at (#2214)

* fix: Sort workspace by name by created_at

Fix bug where deleting workspaces with the same name returns the
oldest deleted workspace
This commit is contained in:
Steven Masley
2022-06-10 09:58:42 -05:00
committed by GitHub
parent 953e8c8fe6
commit 6bee180bb3
10 changed files with 60 additions and 29 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ export const getWorkspaces = async (filter?: TypesGen.WorkspaceFilter): Promise<
export const getWorkspaceByOwnerAndName = async (
username = "me",
workspaceName: string,
params?: TypesGen.WorkspaceByOwnerAndNameParams,
params?: TypesGen.WorkspaceOptions,
): Promise<TypesGen.Workspace> => {
const response = await axios.get<TypesGen.Workspace>(`/api/v2/users/${username}/workspace/${workspaceName}`, {
params,
+1 -6
View File
@@ -464,11 +464,6 @@ export interface WorkspaceBuildsRequest extends Pagination {
readonly WorkspaceID: string
}
// From codersdk/workspaces.go:261:6
export interface WorkspaceByOwnerAndNameParams {
readonly include_deleted?: boolean
}
// From codersdk/workspaces.go:219:6
export interface WorkspaceFilter {
readonly organization_id?: string
@@ -478,7 +473,7 @@ export interface WorkspaceFilter {
// From codersdk/workspaces.go:41:6
export interface WorkspaceOptions {
readonly deleted?: boolean
readonly include_deleted?: boolean
}
// From codersdk/workspaceresources.go:21:6