Fix exposed json variables of filters
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2020-09-07 17:32:55 +02:00
parent c85cb4936f
commit 0691083646
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 35 additions and 139 deletions

View File

@ -24,29 +24,29 @@ import (
// TaskCollection is a struct used to hold filter details and not clutter the Task struct with information not related to actual tasks.
type TaskCollection struct {
ListID int64 `param:"list"`
Lists []*List
ListID int64 `param:"list" json:"-"`
Lists []*List `json:"-"`
// The query parameter to sort by. This is for ex. done, priority, etc.
SortBy []string `query:"sort_by"`
SortByArr []string `query:"sort_by[]"`
SortBy []string `query:"sort_by" json:"sort_by"`
SortByArr []string `query:"sort_by[]" json:"-"`
// The query parameter to order the items by. This can be either asc or desc, with asc being the default.
OrderBy []string `query:"order_by"`
OrderByArr []string `query:"order_by[]"`
OrderBy []string `query:"order_by" json:"order_by"`
OrderByArr []string `query:"order_by[]" json:"-"`
// The field name of the field to filter by
FilterBy []string `query:"filter_by"`
FilterByArr []string `query:"filter_by[]"`
FilterBy []string `query:"filter_by" json:"filter_by"`
FilterByArr []string `query:"filter_by[]" json:"-"`
// The value of the field name to filter by
FilterValue []string `query:"filter_value"`
FilterValueArr []string `query:"filter_value[]"`
FilterValue []string `query:"filter_value" json:"filter_value"`
FilterValueArr []string `query:"filter_value[]" json:"-"`
// The comparator for field and value
FilterComparator []string `query:"filter_comparator"`
FilterComparatorArr []string `query:"filter_comparator[]"`
FilterComparator []string `query:"filter_comparator" json:"filter_comparator"`
FilterComparatorArr []string `query:"filter_comparator[]" json:"-"`
// The way all filter conditions are concatenated together, can be either "and" or "or".,
FilterConcat string `query:"filter_concat"`
FilterConcat string `query:"filter_concat" json:"filter_concat"`
// If set to true, the result will also include null values
FilterIncludeNulls bool `query:"filter_include_nulls"`
FilterIncludeNulls bool `query:"filter_include_nulls" json:"filter_include_nulls"`
web.CRUDable `xorm:"-" json:"-"`
web.Rights `xorm:"-" json:"-"`

View File

@ -7141,87 +7141,48 @@ var doc = `{
"models.TaskCollection": {
"type": "object",
"properties": {
"filterBy": {
"filter_by": {
"description": "The field name of the field to filter by",
"type": "array",
"items": {
"type": "string"
}
},
"filterByArr": {
"type": "array",
"items": {
"type": "string"
}
},
"filterComparator": {
"filter_comparator": {
"description": "The comparator for field and value",
"type": "array",
"items": {
"type": "string"
}
},
"filterComparatorArr": {
"type": "array",
"items": {
"type": "string"
}
},
"filterConcat": {
"filter_concat": {
"description": "The way all filter conditions are concatenated together, can be either \"and\" or \"or\".,",
"type": "string"
},
"filterIncludeNulls": {
"filter_include_nulls": {
"description": "If set to true, the result will also include null values",
"type": "boolean"
},
"filterValue": {
"filter_value": {
"description": "The value of the field name to filter by",
"type": "array",
"items": {
"type": "string"
}
},
"filterValueArr": {
"type": "array",
"items": {
"type": "string"
}
},
"listID": {
"type": "integer"
},
"lists": {
"type": "array",
"items": {
"$ref": "#/definitions/models.List"
}
},
"orderBy": {
"order_by": {
"description": "The query parameter to order the items by. This can be either asc or desc, with asc being the default.",
"type": "array",
"items": {
"type": "string"
}
},
"orderByArr": {
"type": "array",
"items": {
"type": "string"
}
},
"sortBy": {
"sort_by": {
"description": "The query parameter to sort by. This is for ex. done, priority, etc.",
"type": "array",
"items": {
"type": "string"
}
},
"sortByArr": {
"type": "array",
"items": {
"type": "string"
}
}
}
},

View File

@ -7124,87 +7124,48 @@
"models.TaskCollection": {
"type": "object",
"properties": {
"filterBy": {
"filter_by": {
"description": "The field name of the field to filter by",
"type": "array",
"items": {
"type": "string"
}
},
"filterByArr": {
"type": "array",
"items": {
"type": "string"
}
},
"filterComparator": {
"filter_comparator": {
"description": "The comparator for field and value",
"type": "array",
"items": {
"type": "string"
}
},
"filterComparatorArr": {
"type": "array",
"items": {
"type": "string"
}
},
"filterConcat": {
"filter_concat": {
"description": "The way all filter conditions are concatenated together, can be either \"and\" or \"or\".,",
"type": "string"
},
"filterIncludeNulls": {
"filter_include_nulls": {
"description": "If set to true, the result will also include null values",
"type": "boolean"
},
"filterValue": {
"filter_value": {
"description": "The value of the field name to filter by",
"type": "array",
"items": {
"type": "string"
}
},
"filterValueArr": {
"type": "array",
"items": {
"type": "string"
}
},
"listID": {
"type": "integer"
},
"lists": {
"type": "array",
"items": {
"$ref": "#/definitions/models.List"
}
},
"orderBy": {
"order_by": {
"description": "The query parameter to order the items by. This can be either asc or desc, with asc being the default.",
"type": "array",
"items": {
"type": "string"
}
},
"orderByArr": {
"type": "array",
"items": {
"type": "string"
}
},
"sortBy": {
"sort_by": {
"description": "The query parameter to sort by. This is for ex. done, priority, etc.",
"type": "array",
"items": {
"type": "string"
}
},
"sortByArr": {
"type": "array",
"items": {
"type": "string"
}
}
}
},

View File

@ -589,63 +589,37 @@ definitions:
type: object
models.TaskCollection:
properties:
filterBy:
filter_by:
description: The field name of the field to filter by
items:
type: string
type: array
filterByArr:
items:
type: string
type: array
filterComparator:
filter_comparator:
description: The comparator for field and value
items:
type: string
type: array
filterComparatorArr:
items:
type: string
type: array
filterConcat:
filter_concat:
description: The way all filter conditions are concatenated together, can be either "and" or "or".,
type: string
filterIncludeNulls:
filter_include_nulls:
description: If set to true, the result will also include null values
type: boolean
filterValue:
filter_value:
description: The value of the field name to filter by
items:
type: string
type: array
filterValueArr:
items:
type: string
type: array
listID:
type: integer
lists:
items:
$ref: '#/definitions/models.List'
type: array
orderBy:
order_by:
description: The query parameter to order the items by. This can be either asc or desc, with asc being the default.
items:
type: string
type: array
orderByArr:
items:
type: string
type: array
sortBy:
sort_by:
description: The query parameter to sort by. This is for ex. done, priority, etc.
items:
type: string
type: array
sortByArr:
items:
type: string
type: array
type: object
models.TaskComment:
properties: