mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-10 22:17:44 +00:00
fix validation
This commit is contained in:
parent
06b715fa6a
commit
80256b0465
1 changed files with 2 additions and 2 deletions
|
@ -54,8 +54,8 @@ type Watcher struct {
|
||||||
func (w *Watcher) Validate() error {
|
func (w *Watcher) Validate() error {
|
||||||
return validation.ValidateStruct(w,
|
return validation.ValidateStruct(w,
|
||||||
validation.Field(&w.Label, validation.Required, validation.Length(1, 64)),
|
validation.Field(&w.Label, validation.Required, validation.Length(1, 64)),
|
||||||
validation.Field(&w.Type, validation.Required, validation.In(SubredditWatcher, UserWatcher, TrendingWatcher)),
|
validation.Field(&w.Type, validation.In(SubredditWatcher, UserWatcher, TrendingWatcher)),
|
||||||
validation.Field(&w.WatcheeID, validation.Required, validation.Min(1)),
|
validation.Field(&w.WatcheeID, validation.Required),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue