mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user