mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-26 03:52:24 +00:00
refactor validation
This commit is contained in:
parent
4b2802a6ba
commit
be6e6eb96a
4 changed files with 7 additions and 7 deletions
|
|
@ -45,7 +45,7 @@ func (like ForgeLike) IsNewer(compareTo time.Time) bool {
|
|||
func (like ForgeLike) Validate() []string {
|
||||
var result []string
|
||||
result = append(result, validation.ValidateNotEmpty(string(like.Type), "type")...)
|
||||
result = append(result, validation.ValidateOneOf(string(like.Type), []any{"Like"})...)
|
||||
result = append(result, validation.ValidateOneOf(string(like.Type), []any{"Like"}, "type")...)
|
||||
if like.Actor == nil {
|
||||
result = append(result, "Actor my not be nil.")
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue