fix: Remove unused workspace routes in favor of list with filter (#2038)

* fix: Remove unused workspace routes in favor of list with filter

This consolidates the workspace routes into a single place.
It allows users to fetch a workspace by their username and
workspace name, which will be used by the frontend for routing.

* Fix RBAC

* Fix CLI usages
This commit is contained in:
Kyle Carberry
2022-06-03 14:36:08 -05:00
committed by GitHub
parent d8c440188e
commit 43f622a52d
26 changed files with 72 additions and 424 deletions

View File

@ -41,12 +41,8 @@ func autostartShow() *cobra.Command {
if err != nil {
return err
}
organization, err := currentOrganization(cmd, client)
if err != nil {
return err
}
workspace, err := namedWorkspace(cmd, client, organization.ID, args[0])
workspace, err := namedWorkspace(cmd, client, args[0])
if err != nil {
return err
}
@ -93,10 +89,6 @@ func autostartEnable() *cobra.Command {
if err != nil {
return err
}
organization, err := currentOrganization(cmd, client)
if err != nil {
return err
}
spec := fmt.Sprintf("CRON_TZ=%s %s %s * * %s", autostartTimezone, autostartMinute, autostartHour, autostartDayOfWeek)
validSchedule, err := schedule.Weekly(spec)
@ -104,7 +96,7 @@ func autostartEnable() *cobra.Command {
return err
}
workspace, err := namedWorkspace(cmd, client, organization.ID, args[0])
workspace, err := namedWorkspace(cmd, client, args[0])
if err != nil {
return err
}
@ -142,12 +134,8 @@ func autostartDisable() *cobra.Command {
if err != nil {
return err
}
organization, err := currentOrganization(cmd, client)
if err != nil {
return err
}
workspace, err := namedWorkspace(cmd, client, organization.ID, args[0])
workspace, err := namedWorkspace(cmd, client, args[0])
if err != nil {
return err
}