Fix tests for log levels and work on adding title

This commit is contained in:
bel
2020-03-15 16:47:00 +00:00
parent fe6e721d84
commit c1fe373427
4 changed files with 19 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ import (
)
type upsertRequest struct {
Title string `json:"title"`
ID string `json:"id"`
Language string `json:"language"`
Cron string `json:"cron"`
@@ -35,6 +36,9 @@ func (u *upsertRequest) validate() error {
} else if _, err := config.Store.Get(u.ID, ns.Jobs...); err != nil {
return fmt.Errorf("ID provided but not accessible: %v", err)
}
if u.Title == "" {
u.Title = u.ID
}
if u.Language == "" {
return errors.New("language required")
}