Skip to content

Commit 61ef397

Browse files
committed
fix: empty value for project's max parallel tasks
1 parent bf3447c commit 61ef397

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

db/Project.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ type Project struct {
99
ID int `db:"id" json:"id" backup:"-"`
1010
Name string `db:"name" json:"name" binding:"required"`
1111
Created time.Time `db:"created" json:"created" backup:"-"`
12-
Alert bool `db:"alert" json:"alert"`
13-
AlertChat *string `db:"alert_chat" json:"alert_chat"`
14-
MaxParallelTasks int `db:"max_parallel_tasks" json:"max_parallel_tasks"`
12+
Alert bool `db:"alert" json:"alert,omitempty"`
13+
AlertChat *string `db:"alert_chat" json:"alert_chat,omitempty"`
14+
MaxParallelTasks int `db:"max_parallel_tasks" json:"max_parallel_tasks,omitempty"`
1515
Type string `db:"type" json:"type"`
1616
}

web/src/components/ProjectForm.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export default {
5656
getSingleItemUrl() {
5757
return `/api/project/${this.itemId}`;
5858
},
59+
beforeSave() {
60+
if (this.item.max_parallel_tasks === '') {
61+
this.item.max_parallel_tasks = 0;
62+
}
63+
},
5964
},
6065
};
6166
</script>

0 commit comments

Comments
 (0)