diff --git a/api/organizations.go b/api/organizations.go index 1ef4d17..eb6cd0c 100644 --- a/api/organizations.go +++ b/api/organizations.go @@ -179,7 +179,11 @@ func (a *API) updateOrganizationHandler(w http.ResponseWriter, r *http.Request) org.Description = newOrgInfo.Description updateOrg = true } - if newOrgInfo.Size > 0 { + if newOrgInfo.Website != "" { + org.Website = newOrgInfo.Website + updateOrg = true + } + if newOrgInfo.Size != "" { org.Size = newOrgInfo.Size updateOrg = true } @@ -191,6 +195,10 @@ func (a *API) updateOrganizationHandler(w http.ResponseWriter, r *http.Request) org.Logo = newOrgInfo.Logo updateOrg = true } + if newOrgInfo.Header != "" { + org.Header = newOrgInfo.Header + updateOrg = true + } if newOrgInfo.Subdomain != "" { org.Subdomain = newOrgInfo.Subdomain updateOrg = true @@ -199,6 +207,10 @@ func (a *API) updateOrganizationHandler(w http.ResponseWriter, r *http.Request) org.Timezone = newOrgInfo.Timezone updateOrg = true } + if newOrgInfo.Language != "" { + org.Language = newOrgInfo.Language + updateOrg = true + } if newOrgInfo.Active != org.Active { org.Active = newOrgInfo.Active updateOrg = true diff --git a/api/types.go b/api/types.go index b806208..0c3d54a 100644 --- a/api/types.go +++ b/api/types.go @@ -11,14 +11,17 @@ import ( type OrganizationInfo struct { Address string `json:"address"` Name string `json:"name"` + Website string `json:"website"` CreatedAt string `json:"createdAt"` Type string `json:"type"` Description string `json:"description"` - Size uint64 `json:"size"` + Size string `json:"size"` Color string `json:"color"` Logo string `json:"logo"` + Header string `json:"header"` Subdomain string `json:"subdomain"` Timezone string `json:"timezone"` + Language string `json:"language"` Active bool `json:"active"` Parent *OrganizationInfo `json:"parent"` } @@ -92,14 +95,17 @@ func organizationFromDB(dbOrg, parent *db.Organization) *OrganizationInfo { return &OrganizationInfo{ Address: dbOrg.Address, Name: dbOrg.Name, + Website: dbOrg.Website, CreatedAt: dbOrg.CreatedAt.Format(time.RFC3339), Type: string(dbOrg.Type), Description: dbOrg.Description, Size: dbOrg.Size, Color: dbOrg.Color, Logo: dbOrg.Logo, + Header: dbOrg.Header, Subdomain: dbOrg.Subdomain, Timezone: dbOrg.Timezone, + Language: dbOrg.Language, Active: dbOrg.Active, Parent: parentOrg, } diff --git a/db/types.go b/db/types.go index 2b2f8bf..2d5a119 100644 --- a/db/types.go +++ b/db/types.go @@ -32,16 +32,19 @@ type OrganizationMember struct { type Organization struct { Address string `json:"address" bson:"_id"` Name string `json:"name" bson:"name"` + Website string `json:"website" bson:"website"` Type OrganizationType `json:"type" bson:"type"` Creator string `json:"creator" bson:"creator"` CreatedAt time.Time `json:"createdAt" bson:"createdAt"` Nonce string `json:"nonce" bson:"nonce"` Description string `json:"description" bson:"description"` - Size uint64 `json:"size" bson:"size"` + Size string `json:"size" bson:"size"` Color string `json:"color" bson:"color"` Logo string `json:"logo" bson:"logo"` + Header string `json:"header" bson:"header"` Subdomain string `json:"subdomain" bson:"subdomain"` Timezone string `json:"timezone" bson:"timezone"` + Language string `json:"language" bson:"language"` Active bool `json:"active" bson:"active"` TokensPurchased uint64 `json:"tokensPurchased" bson:"tokensPurchased"` TokensRemaining uint64 `json:"tokensRemaining" bson:"tokensRemaining"`