Skip to content

Make fetching workspaces deleted query param consistent #2176

Closed
@Emyrk

Description

@Emyrk

Currently if you attempt to fetch a deleted workspace, if it is deleted you need to include ?deleted=true query parameter. We also have a include_deleted query param in the case that it will return regardless if it is deleted or not.

If you fetch workspaces, then the ?deleted query param only shows deleted workspace OR it shows active workspaces. It will never show a mixed set of deleted and active. From a UI perspective, this is kinda strange, as you'd assume there are cases you want the mixed set.

Proposal

We should keep only the ?deleted query param and treat it as follows:

  • deleted="" : Show both deleted and active
  • This is the default case
  • `deleted="false": Show only active
  • deleted="true": Show only deleted

The empty string applies no filters and returns the mixed set. We should add a Deleted field to Workspace data type for the user to see the workspace status.

Reasoning

Fetching single

When fetching a single workspace, we already have the id or the name. We want to know if the workspace exists regardless of it's state. They should check the Deleted field to know if it's active or not. I assume we might even allow the workspace to be brought back to life in the future?

If they want to only see active/deleted they can use the deleted query param

Fetching multiple

In our other filters we treat empty string as "do not apply the filter", so the same case goes here. We just need that Deleted field for the user to know the status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions