Add bucket limit validation

This commit is contained in:
kolaente 2021-04-15 16:55:21 +02:00
parent 6e5a9868f5
commit f429efc220
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 6 additions and 3 deletions

View File

@ -37,7 +37,7 @@ type Bucket struct {
Tasks []*Task `xorm:"-" json:"tasks"`
// How many tasks can be at the same time on this board max
Limit int64 `xorm:"default 0" json:"limit"`
Limit int64 `xorm:"default 0" json:"limit" minimum:"0" valid:"range(0|9223372036854775807)"`
// If this bucket is the "done bucket". All tasks moved into this bucket will automatically marked as done. All tasks marked as done from elsewhere will be moved into this bucket.
IsDoneBucket bool `xorm:"BOOL" json:"is_done_bucket"`

View File

@ -7204,7 +7204,8 @@ var doc = `{
},
"limit": {
"description": "How many tasks can be at the same time on this board max",
"type": "integer"
"type": "integer",
"minimum": 0
},
"list_id": {
"description": "The list this bucket belongs to.",

View File

@ -7187,7 +7187,8 @@
},
"limit": {
"description": "How many tasks can be at the same time on this board max",
"type": "integer"
"type": "integer",
"minimum": 0
},
"list_id": {
"description": "The list this bucket belongs to.",

View File

@ -91,6 +91,7 @@ definitions:
type: boolean
limit:
description: How many tasks can be at the same time on this board max
minimum: 0
type: integer
list_id:
description: The list this bucket belongs to.