chore: join user information to workspace_build and template_version (#8625)

* include minimial user on template version and build
* Add unit test to ensure join is superset
This commit is contained in:
Steven Masley
2023-07-25 09:14:38 -04:00
committed by GitHub
parent fbb2a6a434
commit de1a7a9210
39 changed files with 819 additions and 717 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ type TemplateVersion struct {
Message string `json:"message"`
Job ProvisionerJob `json:"job"`
Readme string `json:"readme"`
CreatedBy User `json:"created_by"`
CreatedBy MinimalUser `json:"created_by"`
Warnings []TemplateVersionWarning `json:"warnings,omitempty" enums:"DEPRECATED_PARAMETERS"`
}
+8
View File
@@ -33,6 +33,14 @@ type UsersRequest struct {
Pagination
}
// MinimalUser is the minimal information needed to identify a user and show
// them on the UI.
type MinimalUser struct {
ID uuid.UUID `json:"id" validate:"required" table:"id" format:"uuid"`
Username string `json:"username" validate:"required" table:"username,default_sort"`
AvatarURL string `json:"avatar_url" format:"uri"`
}
// User represents a user in Coder.
type User struct {
ID uuid.UUID `json:"id" validate:"required" table:"id" format:"uuid"`