Skip to content

Commit

Permalink
fix(fe): error message for invalid cron format
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Sep 6, 2021
1 parent 813eae8 commit c236737
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/projects/schedules.go
Expand Up @@ -74,7 +74,7 @@ func AddSchedule(w http.ResponseWriter, r *http.Request) {
err := schedules.ValidateCronFormat(schedule.CronFormat)
if err != nil {
helpers.WriteJSON(w, http.StatusBadRequest, map[string]string{
"error": err.Error(),
"error": "Cron: " + err.Error(),
})
return
}
Expand Down Expand Up @@ -133,7 +133,7 @@ func UpdateSchedule(w http.ResponseWriter, r *http.Request) {
err := schedules.ValidateCronFormat(schedule.CronFormat)
if err != nil {
helpers.WriteJSON(w, http.StatusBadRequest, map[string]string{
"error": err.Error(),
"error": "Cron: " + err.Error(),
})
return
}
Expand Down
5 changes: 4 additions & 1 deletion api/schedules/pool.go
Expand Up @@ -14,7 +14,10 @@ type ScheduleRunner struct {
}

func (r ScheduleRunner) Run() {
_, err := tasks.AddTaskToPool(r.Store, db.Task{}, nil, r.Schedule.ProjectID)
_, err := tasks.AddTaskToPool(r.Store, db.Task{
TemplateID: r.Schedule.TemplateID,
ProjectID: r.Schedule.ProjectID,
}, nil, r.Schedule.ProjectID)
if err != nil {
log.Error(err)
}
Expand Down
6 changes: 6 additions & 0 deletions web2/src/components/TemplateForm.vue
Expand Up @@ -5,6 +5,12 @@
v-model="formValid"
v-if="isLoaded"
>
<v-alert
:value="formError"
color="error"
class="pb-2"
>{{ formError }}</v-alert>

<v-row>
<v-col cols="12" md="6" class="pb-0">
<v-text-field
Expand Down
2 changes: 1 addition & 1 deletion web2/src/views/project/Templates.vue
Expand Up @@ -7,7 +7,7 @@
</div>
<div v-else>
<EditDialog
max-width="700"
:max-width="700"
v-model="editDialog"
save-button-text="Create"
title="New template"
Expand Down

0 comments on commit c236737

Please sign in to comment.