Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-22 09:54:24 +01:00

fix field names

This commit is contained in:
Michael Jerger 2024-05-01 15:46:03 +02:00
parent 715ff0eb7f
commit 534d692d68
2 changed files with 3 additions and 3 deletions

View file

@ -218,9 +218,9 @@ func (s *ForgePerson) UnmarshalJSON(data []byte) error {
func (s ForgePerson) Validate() []string {
var result []string
result = append(result, validation.ValidateNotEmpty(string(s.Type), "type")...)
result = append(result, validation.ValidateNotEmpty(string(s.Type), "Type")...)
result = append(result, validation.ValidateOneOf(string(s.Type), []any{string(ap.PersonType)}, "Type")...)
result = append(result, validation.ValidateNotEmpty(s.PreferredUsername.String(), "preferredUsername")...)
result = append(result, validation.ValidateNotEmpty(s.PreferredUsername.String(), "PreferredUsername")...)
return result
}

View file

@ -128,7 +128,7 @@ func NewNodeInfo(body []byte) (NodeInfo, error) {
// Validate collects error strings in a slice and returns this
func (node NodeInfo) Validate() []string {
var result []string
result = append(result, validation.ValidateNotEmpty(string(node.SoftwareName), "source")...)
result = append(result, validation.ValidateNotEmpty(string(node.SoftwareName), "node.SoftwareName")...)
result = append(result, validation.ValidateOneOf(node.SoftwareName, KnownSourceTypes, "node.SoftwareName")...)
return result