refactor validation

This commit is contained in:
Michael Jerger 2024-05-01 15:02:27 +02:00
commit be6e6eb96a
4 changed files with 7 additions and 7 deletions

View file

@ -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 {