diff options
author | KN4CK3R <KN4CK3R@users.noreply.github.com> | 2021-05-02 21:03:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 21:03:15 +0200 |
commit | 8c8471e75464fa6253a44cdbb8f6ad233aae9067 (patch) | |
tree | f8fd7e87b26f2b735208cb95de147c2ef93d814e /modules/structs/org.go | |
parent | 0590176a23c056b274bd30ff7cec8f8a203f0665 (diff) | |
download | gitea-8c8471e75464fa6253a44cdbb8f6ad233aae9067.tar.gz gitea-8c8471e75464fa6253a44cdbb8f6ad233aae9067.zip |
Addition to (Add Location, Website and Description to API #15675) (#15690)
* Use same name as other structs.
* Sync with normal forms.
* Edit description with API.
* Workaround for nil value.
Diffstat (limited to 'modules/structs/org.go')
-rw-r--r-- | modules/structs/org.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/structs/org.go b/modules/structs/org.go index 4b79a4e70a..483f5044a8 100644 --- a/modules/structs/org.go +++ b/modules/structs/org.go @@ -22,9 +22,9 @@ type CreateOrgOption struct { // required: true UserName string `json:"username" binding:"Required"` FullName string `json:"full_name"` - Description string `json:"description"` - Website string `json:"website"` - Location string `json:"location"` + Description string `json:"description" binding:"MaxSize(255)"` + Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` + Location string `json:"location" binding:"MaxSize(50)"` // possible values are `public` (default), `limited` or `private` // enum: public,limited,private Visibility string `json:"visibility" binding:"In(,public,limited,private)"` @@ -34,9 +34,9 @@ type CreateOrgOption struct { // EditOrgOption options for editing an organization type EditOrgOption struct { FullName string `json:"full_name"` - Description string `json:"description"` - Website string `json:"website"` - Location string `json:"location"` + Description string `json:"description" binding:"MaxSize(255)"` + Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` + Location string `json:"location" binding:"MaxSize(50)"` // possible values are `public`, `limited` or `private` // enum: public,limited,private Visibility string `json:"visibility" binding:"In(,public,limited,private)"` |