Reuse chronograf.Organization type

pull/10616/head
Luke Morris 2017-11-10 18:31:28 -08:00
parent 6d2c7e18d1
commit 9eccded4b2
2 changed files with 4 additions and 10 deletions

View File

@ -788,7 +788,7 @@ type Organization struct {
DefaultRole string `json:"defaultRole,omitempty"`
// Public specifies whether users must be explicitly added to the organization.
// It is currently only used by the default organization, but that may change in the future.
Public bool `json:"public,omitempty"`
Public bool `json:"public"`
}
// OrganizationQuery represents the attributes that a organization may be retrieved by.

View File

@ -57,19 +57,13 @@ func (r *organizationRequest) ValidDefaultRole() error {
}
type organizationResponse struct {
Links selfLinks `json:"links"`
ID uint64 `json:"id,string"`
Name string `json:"name"`
DefaultRole string `json:"defaultRole,omitempty"`
Public bool `json:"public"`
Links selfLinks `json:"links"`
chronograf.Organization
}
func newOrganizationResponse(o *chronograf.Organization) *organizationResponse {
return &organizationResponse{
ID: o.ID,
Name: o.Name,
DefaultRole: o.DefaultRole,
Public: o.Public,
Organization: *o,
Links: selfLinks{
Self: fmt.Sprintf("/chronograf/v1/organizations/%d", o.ID),
},