feat(coderd): allow workspace owners to mark workspaces as favorite (#11791)

- Adds column `favorite` to workspaces table
- Adds API endpoints to favorite/unfavorite workspaces
- Modifies sorting order to return owners' favorite workspaces first
This commit is contained in:
Cian Johnston
2024-01-24 13:39:19 +00:00
committed by GitHub
parent 6145da8a9e
commit f92336c4d5
27 changed files with 646 additions and 50 deletions

59
coderd/apidoc/docs.go generated
View File

@ -6999,6 +6999,62 @@ const docTemplate = `{
}
}
},
"/workspaces/{workspace}/favorite": {
"put": {
"security": [
{
"CoderSessionToken": []
}
],
"tags": [
"Workspaces"
],
"summary": "Favorite workspace by ID.",
"operationId": "favorite-workspace-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
},
"delete": {
"security": [
{
"CoderSessionToken": []
}
],
"tags": [
"Workspaces"
],
"summary": "Unfavorite workspace by ID.",
"operationId": "unfavorite-workspace-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/workspaces/{workspace}/resolve-autostart": {
"get": {
"security": [
@ -11926,6 +11982,9 @@ const docTemplate = `{
"type": "string",
"format": "date-time"
},
"favorite": {
"type": "boolean"
},
"health": {
"description": "Health shows the health of the workspace and information about\nwhat is causing an unhealthy status.",
"allOf": [