mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: add workspace option 'deleted' to options type (#2095)
* fix: add workspace option 'deleted' to options type * dead code
This commit is contained in:
@ -60,12 +60,6 @@ func (api *API) workspace(rw http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
return
|
||||
}
|
||||
if !workspace.Deleted && showDeleted {
|
||||
httpapi.Write(rw, http.StatusBadRequest, httpapi.Response{
|
||||
Message: fmt.Sprintf("Workspace %q is not deleted, please remove '?deleted=true' and try again", workspace.ID.String()),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
build, err := api.Database.GetLatestWorkspaceBuildByWorkspaceID(r.Context(), workspace.ID)
|
||||
if err != nil {
|
||||
|
@ -46,10 +46,9 @@ func TestWorkspace(t *testing.T) {
|
||||
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
|
||||
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
|
||||
|
||||
// Getting with deleted=true should fail.
|
||||
// Getting with deleted=true should still work.
|
||||
_, err := client.DeletedWorkspace(context.Background(), workspace.ID)
|
||||
require.Error(t, err)
|
||||
require.ErrorContains(t, err, "400") // bad request
|
||||
require.NoError(t, err)
|
||||
|
||||
// Delete the workspace
|
||||
build, err := client.CreateWorkspaceBuild(context.Background(), workspace.ID, codersdk.CreateWorkspaceBuildRequest{
|
||||
|
Reference in New Issue
Block a user