mirror of
https://github.com/knadh/listmonk.git
synced 2025-01-06 06:05:48 +08:00
Validate the status
field in create subscriber API
This commit is contained in:
parent
ccd354df3f
commit
c7fc1aa506
1 changed files with 5 additions and 1 deletions
|
@ -561,7 +561,11 @@ func ValidateFields(s SubReq) error {
|
|||
if !govalidator.IsByteLength(s.Name, 1, stdInputMaxLen) {
|
||||
return errors.New(`invalid or empty name "` + s.Name + `"`)
|
||||
}
|
||||
|
||||
if s.Status != models.SubscriberStatusEnabled &&
|
||||
s.Status != models.SubscriberStatusDisabled &&
|
||||
s.Status != models.SubscriberStatusBlackListed {
|
||||
return errors.New(`invalid or empty status "` + s.Status + `"`)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue