Use query params to sort tasks instead of url params (#61)
This commit is contained in:
parent
a06a5fc4f4
commit
15ef6deabc
8 changed files with 86 additions and 421 deletions
|
@ -162,7 +162,7 @@ Sorry for some of them being in German, I'll tranlate them at some point.
|
||||||
|
|
||||||
* [x] ListTaskRights, sollte überall gleich funktionieren, gibt ja mittlerweile auch eine Methode um liste von nem Task aus zu kriegen oder so
|
* [x] ListTaskRights, sollte überall gleich funktionieren, gibt ja mittlerweile auch eine Methode um liste von nem Task aus zu kriegen oder so
|
||||||
* [x] Re-check all `{List|Namespace}{User|Team}` if really all parameters need to be exposed via json or are overwritten via param anyway.
|
* [x] Re-check all `{List|Namespace}{User|Team}` if really all parameters need to be exposed via json or are overwritten via param anyway.
|
||||||
* [ ] Things like list/task order should use queries and not url params
|
* [x] Things like list/task order should use queries and not url params
|
||||||
* [ ] Fix lint errors
|
* [ ] Fix lint errors
|
||||||
|
|
||||||
### Linters
|
### Linters
|
||||||
|
|
|
@ -112,7 +112,7 @@ Authorization: Bearer {{auth_token}}
|
||||||
###
|
###
|
||||||
|
|
||||||
# Get all pending tasks with priorities
|
# Get all pending tasks with priorities
|
||||||
GET http://localhost:8080/api/v1/tasks/all/desc
|
GET http://localhost:8080/api/v1/tasks/all?sort=priorityasc
|
||||||
Authorization: Bearer {{auth_token}}
|
Authorization: Bearer {{auth_token}}
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
|
@ -23,42 +23,6 @@ const (
|
||||||
SortTasksByPriorityDesc
|
SortTasksByPriorityDesc
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadAllWithPriority gets all tasks for a user, sorted
|
|
||||||
// @Summary Get tasks sorted
|
|
||||||
// @Description Returns all tasks on any list the user has access to.
|
|
||||||
// @tags task
|
|
||||||
// @Accept json
|
|
||||||
// @Produce json
|
|
||||||
// @Param p query int false "The page number. Used for pagination. If not provided, the first page of results is returned."
|
|
||||||
// @Param s query string false "Search tasks by task text."
|
|
||||||
// @Param sortby path string true "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc."
|
|
||||||
// @Security JWTKeyAuth
|
|
||||||
// @Success 200 {array} models.List "The tasks"
|
|
||||||
// @Failure 500 {object} models.Message "Internal error"
|
|
||||||
// @Router /tasks/all/{sortby} [get]
|
|
||||||
func dummy() {
|
|
||||||
// Dummy function for swaggo to pick up the docs comment
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadAllWithPriorityAndDateRange gets all tasks for a user, sorted
|
|
||||||
// @Summary Get tasks sorted and within a date range
|
|
||||||
// @Description Returns all tasks on any list the user has access to.
|
|
||||||
// @tags task
|
|
||||||
// @Accept json
|
|
||||||
// @Produce json
|
|
||||||
// @Param p query int false "The page number. Used for pagination. If not provided, the first page of results is returned."
|
|
||||||
// @Param s query string false "Search tasks by task text."
|
|
||||||
// @Param sortby path string true "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc."
|
|
||||||
// @Param startdate path string true "The start date parameter. Expects a unix timestamp."
|
|
||||||
// @Param enddate path string true "The end date parameter. Expects a unix timestamp."
|
|
||||||
// @Security JWTKeyAuth
|
|
||||||
// @Success 200 {array} models.List "The tasks"
|
|
||||||
// @Failure 500 {object} models.Message "Internal error"
|
|
||||||
// @Router /tasks/all/{sortby}/{startdate}/{enddate} [get]
|
|
||||||
func dummy2() {
|
|
||||||
// Dummy function for swaggo to pick up the docs comment
|
|
||||||
}
|
|
||||||
|
|
||||||
// ReadAll gets all tasks for a user
|
// ReadAll gets all tasks for a user
|
||||||
// @Summary Get tasks
|
// @Summary Get tasks
|
||||||
// @Description Returns all tasks on any list the user has access to.
|
// @Description Returns all tasks on any list the user has access to.
|
||||||
|
@ -67,6 +31,9 @@ func dummy2() {
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param p query int false "The page number. Used for pagination. If not provided, the first page of results is returned."
|
// @Param p query int false "The page number. Used for pagination. If not provided, the first page of results is returned."
|
||||||
// @Param s query string false "Search tasks by task text."
|
// @Param s query string false "Search tasks by task text."
|
||||||
|
// @Param sort query string false "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc."
|
||||||
|
// @Param startdate query int false "The start date parameter to filter by. Expects a unix timestamp."
|
||||||
|
// @Param enddate query int false "The end date parameter to filter by. Expects a unix timestamp."
|
||||||
// @Security JWTKeyAuth
|
// @Security JWTKeyAuth
|
||||||
// @Success 200 {array} models.List "The tasks"
|
// @Success 200 {array} models.List "The tasks"
|
||||||
// @Failure 500 {object} models.Message "Internal error"
|
// @Failure 500 {object} models.Message "Internal error"
|
||||||
|
|
|
@ -45,17 +45,17 @@ type ListTask struct {
|
||||||
// The task priority. Can be anything you want, it is possible to sort by this later.
|
// The task priority. Can be anything you want, it is possible to sort by this later.
|
||||||
Priority int64 `xorm:"int(11)" json:"priority"`
|
Priority int64 `xorm:"int(11)" json:"priority"`
|
||||||
// When this task starts.
|
// When this task starts.
|
||||||
StartDateUnix int64 `xorm:"int(11) INDEX" json:"startDate"`
|
StartDateUnix int64 `xorm:"int(11) INDEX" json:"startDate" query:"-"`
|
||||||
// When this task ends.
|
// When this task ends.
|
||||||
EndDateUnix int64 `xorm:"int(11) INDEX" json:"endDate"`
|
EndDateUnix int64 `xorm:"int(11) INDEX" json:"endDate" query:"-"`
|
||||||
// An array of users who are assigned to this task
|
// An array of users who are assigned to this task
|
||||||
Assignees []*User `xorm:"-" json:"assignees"`
|
Assignees []*User `xorm:"-" json:"assignees"`
|
||||||
// An array of labels which are associated with this task.
|
// An array of labels which are associated with this task.
|
||||||
Labels []*Label `xorm:"-" json:"labels"`
|
Labels []*Label `xorm:"-" json:"labels"`
|
||||||
|
|
||||||
Sorting string `xorm:"-" json:"-" param:"sort"` // Parameter to sort by
|
Sorting string `xorm:"-" json:"-" query:"sort"` // Parameter to sort by
|
||||||
StartDateSortUnix int64 `xorm:"-" json:"-" param:"startdatefilter"`
|
StartDateSortUnix int64 `xorm:"-" json:"-" query:"startdate"`
|
||||||
EndDateSortUnix int64 `xorm:"-" json:"-" param:"enddatefilter"`
|
EndDateSortUnix int64 `xorm:"-" json:"-" query:"enddate"`
|
||||||
|
|
||||||
// An array of subtasks.
|
// An array of subtasks.
|
||||||
Subtasks []*ListTask `xorm:"-" json:"subtasks"`
|
Subtasks []*ListTask `xorm:"-" json:"subtasks"`
|
||||||
|
|
|
@ -242,8 +242,6 @@ func RegisterRoutes(e *echo.Echo) {
|
||||||
}
|
}
|
||||||
a.PUT("/lists/:list", taskHandler.CreateWeb)
|
a.PUT("/lists/:list", taskHandler.CreateWeb)
|
||||||
a.GET("/tasks/all", taskHandler.ReadAllWeb)
|
a.GET("/tasks/all", taskHandler.ReadAllWeb)
|
||||||
a.GET("/tasks/all/:sort", taskHandler.ReadAllWeb)
|
|
||||||
a.GET("/tasks/all/:sort/:startdatefilter/:enddatefilter", taskHandler.ReadAllWeb)
|
|
||||||
a.DELETE("/tasks/:listtask", taskHandler.DeleteWeb)
|
a.DELETE("/tasks/:listtask", taskHandler.DeleteWeb)
|
||||||
a.POST("/tasks/:listtask", taskHandler.UpdateWeb)
|
a.POST("/tasks/:listtask", taskHandler.UpdateWeb)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||||
// This file was generated by swaggo/swag at
|
// This file was generated by swaggo/swag at
|
||||||
// 2019-01-31 20:54:13.368738869 +0100 CET m=+0.182170800
|
// 2019-02-18 18:58:14.354492295 +0100 CET m=+0.122724247
|
||||||
|
|
||||||
package swagger
|
package swagger
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import (
|
||||||
var doc = `{
|
var doc = `{
|
||||||
"swagger": "2.0",
|
"swagger": "2.0",
|
||||||
"info": {
|
"info": {
|
||||||
"description": "\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
|
"description": "This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. \u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs ` + "`" + `Authorization: Bearer \u003cjwt-token\u003e` + "`" + `-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
|
||||||
"title": "Vikunja API",
|
"title": "Vikunja API",
|
||||||
"contact": {
|
"contact": {
|
||||||
"name": "General Vikunja contact",
|
"name": "General Vikunja contact",
|
||||||
|
@ -37,7 +37,7 @@ var doc = `{
|
||||||
"JWTKeyAuth": []
|
"JWTKeyAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
|
"description": "Returns an array with all assignees for this task.",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
@ -45,9 +45,9 @@ var doc = `{
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"labels"
|
"assignees"
|
||||||
],
|
],
|
||||||
"summary": "Get all labels a user has access to",
|
"summary": "Get all assignees for a task",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -57,18 +57,18 @@ var doc = `{
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Search labels by label text.",
|
"description": "Search assignees by their username.",
|
||||||
"name": "s",
|
"name": "s",
|
||||||
"in": "query"
|
"in": "query"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The labels",
|
"description": "The assignees",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/models.Label"
|
"$ref": "#/definitions/models.User"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -391,7 +391,7 @@ var doc = `{
|
||||||
"JWTKeyAuth": []
|
"JWTKeyAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Returns a list by its ID.",
|
"description": "Returns a team by its ID.",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
@ -399,13 +399,13 @@ var doc = `{
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"list"
|
"team"
|
||||||
],
|
],
|
||||||
"summary": "Gets one list",
|
"summary": "Gets one team",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "List ID",
|
"description": "Team ID",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
@ -413,14 +413,14 @@ var doc = `{
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The list",
|
"description": "The team",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"$ref": "#/definitions/models.List"
|
"$ref": "#/definitions/models.Team"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"description": "The user does not have access to the list",
|
"description": "The user does not have access to the team",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
|
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
|
||||||
|
@ -2267,58 +2267,6 @@ var doc = `{
|
||||||
"task"
|
"task"
|
||||||
],
|
],
|
||||||
"summary": "Get tasks",
|
"summary": "Get tasks",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "integer",
|
|
||||||
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
|
|
||||||
"name": "p",
|
|
||||||
"in": "query"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Search tasks by task text.",
|
|
||||||
"name": "s",
|
|
||||||
"in": "query"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "The tasks",
|
|
||||||
"schema": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/models.List"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal error",
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"$ref": "#/definitions/models.Message"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/tasks/all/{sortby}": {
|
|
||||||
"get": {
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"JWTKeyAuth": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Returns all tasks on any list the user has access to.",
|
|
||||||
"consumes": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"task"
|
|
||||||
],
|
|
||||||
"summary": "Get tasks sorted",
|
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -2335,82 +2283,20 @@ var doc = `{
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.",
|
"description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.",
|
||||||
"name": "sortby",
|
"name": "sort",
|
||||||
"in": "path",
|
"in": "query"
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "The tasks",
|
|
||||||
"schema": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/models.List"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"500": {
|
|
||||||
"description": "Internal error",
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"$ref": "#/definitions/models.Message"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/tasks/all/{sortby}/{startdate}/{enddate}": {
|
|
||||||
"get": {
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"JWTKeyAuth": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Returns all tasks on any list the user has access to.",
|
|
||||||
"consumes": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"task"
|
|
||||||
],
|
|
||||||
"summary": "Get tasks sorted and within a date range",
|
|
||||||
"parameters": [
|
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
|
"description": "The start date parameter to filter by. Expects a unix timestamp.",
|
||||||
"name": "p",
|
|
||||||
"in": "query"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Search tasks by task text.",
|
|
||||||
"name": "s",
|
|
||||||
"in": "query"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.",
|
|
||||||
"name": "sortby",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "The start date parameter. Expects a unix timestamp.",
|
|
||||||
"name": "startdate",
|
"name": "startdate",
|
||||||
"in": "path",
|
"in": "query"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "integer",
|
||||||
"description": "The end date parameter. Expects a unix timestamp.",
|
"description": "The end date parameter to filter by. Expects a unix timestamp.",
|
||||||
"name": "enddate",
|
"name": "enddate",
|
||||||
"in": "path",
|
"in": "query"
|
||||||
"required": true
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"swagger": "2.0",
|
"swagger": "2.0",
|
||||||
"info": {
|
"info": {
|
||||||
"description": "\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
|
"description": "This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. \u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e\n# Authorization\n**JWT-Auth:** Main authorization method, used for most of the requests. Needs ` + \"`\" + `Authorization: Bearer \u003cjwt-token\u003e` + \"`\" + `-header to authenticate successfully.\n\n**BasicAuth:** Only used when requesting tasks via caldav.\n\u003c!-- ReDoc-Inject: \u003csecurity-definitions\u003e --\u003e",
|
||||||
"title": "Vikunja API",
|
"title": "Vikunja API",
|
||||||
"contact": {
|
"contact": {
|
||||||
"name": "General Vikunja contact",
|
"name": "General Vikunja contact",
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
"JWTKeyAuth": []
|
"JWTKeyAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Returns all labels which are either created by the user or associated with a task the user has at least read-access to.",
|
"description": "Returns an array with all assignees for this task.",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
@ -32,9 +32,9 @@
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"labels"
|
"assignees"
|
||||||
],
|
],
|
||||||
"summary": "Get all labels a user has access to",
|
"summary": "Get all assignees for a task",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -44,18 +44,18 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Search labels by label text.",
|
"description": "Search assignees by their username.",
|
||||||
"name": "s",
|
"name": "s",
|
||||||
"in": "query"
|
"in": "query"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The labels",
|
"description": "The assignees",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/models.Label"
|
"$ref": "#/definitions/models.User"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -378,7 +378,7 @@
|
||||||
"JWTKeyAuth": []
|
"JWTKeyAuth": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"description": "Returns a list by its ID.",
|
"description": "Returns a team by its ID.",
|
||||||
"consumes": [
|
"consumes": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
|
@ -386,13 +386,13 @@
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
"tags": [
|
"tags": [
|
||||||
"list"
|
"team"
|
||||||
],
|
],
|
||||||
"summary": "Gets one list",
|
"summary": "Gets one team",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "List ID",
|
"description": "Team ID",
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
@ -400,14 +400,14 @@
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "The list",
|
"description": "The team",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"$ref": "#/definitions/models.List"
|
"$ref": "#/definitions/models.Team"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"403": {
|
"403": {
|
||||||
"description": "The user does not have access to the list",
|
"description": "The user does not have access to the team",
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
|
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
|
||||||
|
@ -2254,58 +2254,6 @@
|
||||||
"task"
|
"task"
|
||||||
],
|
],
|
||||||
"summary": "Get tasks",
|
"summary": "Get tasks",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"type": "integer",
|
|
||||||
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
|
|
||||||
"name": "p",
|
|
||||||
"in": "query"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Search tasks by task text.",
|
|
||||||
"name": "s",
|
|
||||||
"in": "query"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "The tasks",
|
|
||||||
"schema": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/models.List"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"500": {
|
|
||||||
"description": "Internal error",
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"$ref": "#/definitions/models.Message"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/tasks/all/{sortby}": {
|
|
||||||
"get": {
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"JWTKeyAuth": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Returns all tasks on any list the user has access to.",
|
|
||||||
"consumes": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"task"
|
|
||||||
],
|
|
||||||
"summary": "Get tasks sorted",
|
|
||||||
"parameters": [
|
"parameters": [
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
@ -2322,82 +2270,20 @@
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.",
|
"description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.",
|
||||||
"name": "sortby",
|
"name": "sort",
|
||||||
"in": "path",
|
"in": "query"
|
||||||
"required": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
|
||||||
"200": {
|
|
||||||
"description": "The tasks",
|
|
||||||
"schema": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/models.List"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"500": {
|
|
||||||
"description": "Internal error",
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"$ref": "#/definitions/models.Message"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"/tasks/all/{sortby}/{startdate}/{enddate}": {
|
|
||||||
"get": {
|
|
||||||
"security": [
|
|
||||||
{
|
|
||||||
"JWTKeyAuth": []
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Returns all tasks on any list the user has access to.",
|
|
||||||
"consumes": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"produces": [
|
|
||||||
"application/json"
|
|
||||||
],
|
|
||||||
"tags": [
|
|
||||||
"task"
|
|
||||||
],
|
|
||||||
"summary": "Get tasks sorted and within a date range",
|
|
||||||
"parameters": [
|
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "The page number. Used for pagination. If not provided, the first page of results is returned.",
|
"description": "The start date parameter to filter by. Expects a unix timestamp.",
|
||||||
"name": "p",
|
|
||||||
"in": "query"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "Search tasks by task text.",
|
|
||||||
"name": "s",
|
|
||||||
"in": "query"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "The sorting parameter. Possible values to sort by are priority, prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.",
|
|
||||||
"name": "sortby",
|
|
||||||
"in": "path",
|
|
||||||
"required": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"description": "The start date parameter. Expects a unix timestamp.",
|
|
||||||
"name": "startdate",
|
"name": "startdate",
|
||||||
"in": "path",
|
"in": "query"
|
||||||
"required": true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "string",
|
"type": "integer",
|
||||||
"description": "The end date parameter. Expects a unix timestamp.",
|
"description": "The end date parameter to filter by. Expects a unix timestamp.",
|
||||||
"name": "enddate",
|
"name": "enddate",
|
||||||
"in": "path",
|
"in": "query"
|
||||||
"required": true
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
|
|
|
@ -622,7 +622,13 @@ info:
|
||||||
email: hello@vikunja.io
|
email: hello@vikunja.io
|
||||||
name: General Vikunja contact
|
name: General Vikunja contact
|
||||||
url: http://vikunja.io/en/contact/
|
url: http://vikunja.io/en/contact/
|
||||||
description: '<!-- ReDoc-Inject: <security-definitions> -->'
|
description: |-
|
||||||
|
This is the documentation for the [Vikunja](http://vikunja.io) API. Vikunja is a cross-plattform Todo-application with a lot of features, such as sharing lists with users or teams. <!-- ReDoc-Inject: <security-definitions> -->
|
||||||
|
# Authorization
|
||||||
|
**JWT-Auth:** Main authorization method, used for most of the requests. Needs ` + "`" + `Authorization: Bearer <jwt-token>` + "`" + `-header to authenticate successfully.
|
||||||
|
|
||||||
|
**BasicAuth:** Only used when requesting tasks via caldav.
|
||||||
|
<!-- ReDoc-Inject: <security-definitions> -->
|
||||||
license:
|
license:
|
||||||
name: GPLv3
|
name: GPLv3
|
||||||
url: http://code.vikunja.io/api/src/branch/master/LICENSE
|
url: http://code.vikunja.io/api/src/branch/master/LICENSE
|
||||||
|
@ -633,15 +639,14 @@ paths:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Returns all labels which are either created by the user or associated
|
description: Returns an array with all assignees for this task.
|
||||||
with a task the user has at least read-access to.
|
|
||||||
parameters:
|
parameters:
|
||||||
- description: The page number. Used for pagination. If not provided, the first
|
- description: The page number. Used for pagination. If not provided, the first
|
||||||
page of results is returned.
|
page of results is returned.
|
||||||
in: query
|
in: query
|
||||||
name: p
|
name: p
|
||||||
type: integer
|
type: integer
|
||||||
- description: Search labels by label text.
|
- description: Search assignees by their username.
|
||||||
in: query
|
in: query
|
||||||
name: s
|
name: s
|
||||||
type: string
|
type: string
|
||||||
|
@ -649,10 +654,10 @@ paths:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: The labels
|
description: The assignees
|
||||||
schema:
|
schema:
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/models.Label'
|
$ref: '#/definitions/models.User'
|
||||||
type: array
|
type: array
|
||||||
"500":
|
"500":
|
||||||
description: Internal error
|
description: Internal error
|
||||||
|
@ -661,9 +666,9 @@ paths:
|
||||||
type: object
|
type: object
|
||||||
security:
|
security:
|
||||||
- JWTKeyAuth: []
|
- JWTKeyAuth: []
|
||||||
summary: Get all labels a user has access to
|
summary: Get all assignees for a task
|
||||||
tags:
|
tags:
|
||||||
- labels
|
- assignees
|
||||||
put:
|
put:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
|
@ -907,9 +912,9 @@ paths:
|
||||||
get:
|
get:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
description: Returns a list by its ID.
|
description: Returns a team by its ID.
|
||||||
parameters:
|
parameters:
|
||||||
- description: List ID
|
- description: Team ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
required: true
|
required: true
|
||||||
|
@ -918,12 +923,12 @@ paths:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: The list
|
description: The team
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/models.List'
|
$ref: '#/definitions/models.Team'
|
||||||
type: object
|
type: object
|
||||||
"403":
|
"403":
|
||||||
description: The user does not have access to the list
|
description: The user does not have access to the team
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
|
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
|
||||||
type: object
|
type: object
|
||||||
|
@ -934,9 +939,9 @@ paths:
|
||||||
type: object
|
type: object
|
||||||
security:
|
security:
|
||||||
- JWTKeyAuth: []
|
- JWTKeyAuth: []
|
||||||
summary: Gets one list
|
summary: Gets one team
|
||||||
tags:
|
tags:
|
||||||
- list
|
- team
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
- application/json
|
- application/json
|
||||||
|
@ -2527,6 +2532,19 @@ paths:
|
||||||
in: query
|
in: query
|
||||||
name: s
|
name: s
|
||||||
type: string
|
type: string
|
||||||
|
- description: The sorting parameter. Possible values to sort by are priority,
|
||||||
|
prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.
|
||||||
|
in: query
|
||||||
|
name: sort
|
||||||
|
type: string
|
||||||
|
- description: The start date parameter to filter by. Expects a unix timestamp.
|
||||||
|
in: query
|
||||||
|
name: startdate
|
||||||
|
type: integer
|
||||||
|
- description: The end date parameter to filter by. Expects a unix timestamp.
|
||||||
|
in: query
|
||||||
|
name: enddate
|
||||||
|
type: integer
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
|
@ -2546,96 +2564,6 @@ paths:
|
||||||
summary: Get tasks
|
summary: Get tasks
|
||||||
tags:
|
tags:
|
||||||
- task
|
- task
|
||||||
/tasks/all/{sortby}:
|
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Returns all tasks on any list the user has access to.
|
|
||||||
parameters:
|
|
||||||
- description: The page number. Used for pagination. If not provided, the first
|
|
||||||
page of results is returned.
|
|
||||||
in: query
|
|
||||||
name: p
|
|
||||||
type: integer
|
|
||||||
- description: Search tasks by task text.
|
|
||||||
in: query
|
|
||||||
name: s
|
|
||||||
type: string
|
|
||||||
- description: The sorting parameter. Possible values to sort by are priority,
|
|
||||||
prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.
|
|
||||||
in: path
|
|
||||||
name: sortby
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: The tasks
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/definitions/models.List'
|
|
||||||
type: array
|
|
||||||
"500":
|
|
||||||
description: Internal error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/models.Message'
|
|
||||||
type: object
|
|
||||||
security:
|
|
||||||
- JWTKeyAuth: []
|
|
||||||
summary: Get tasks sorted
|
|
||||||
tags:
|
|
||||||
- task
|
|
||||||
/tasks/all/{sortby}/{startdate}/{enddate}:
|
|
||||||
get:
|
|
||||||
consumes:
|
|
||||||
- application/json
|
|
||||||
description: Returns all tasks on any list the user has access to.
|
|
||||||
parameters:
|
|
||||||
- description: The page number. Used for pagination. If not provided, the first
|
|
||||||
page of results is returned.
|
|
||||||
in: query
|
|
||||||
name: p
|
|
||||||
type: integer
|
|
||||||
- description: Search tasks by task text.
|
|
||||||
in: query
|
|
||||||
name: s
|
|
||||||
type: string
|
|
||||||
- description: The sorting parameter. Possible values to sort by are priority,
|
|
||||||
prioritydesc, priorityasc, dueadate, dueadatedesc, dueadateasc.
|
|
||||||
in: path
|
|
||||||
name: sortby
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
- description: The start date parameter. Expects a unix timestamp.
|
|
||||||
in: path
|
|
||||||
name: startdate
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
- description: The end date parameter. Expects a unix timestamp.
|
|
||||||
in: path
|
|
||||||
name: enddate
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
produces:
|
|
||||||
- application/json
|
|
||||||
responses:
|
|
||||||
"200":
|
|
||||||
description: The tasks
|
|
||||||
schema:
|
|
||||||
items:
|
|
||||||
$ref: '#/definitions/models.List'
|
|
||||||
type: array
|
|
||||||
"500":
|
|
||||||
description: Internal error
|
|
||||||
schema:
|
|
||||||
$ref: '#/definitions/models.Message'
|
|
||||||
type: object
|
|
||||||
security:
|
|
||||||
- JWTKeyAuth: []
|
|
||||||
summary: Get tasks sorted and within a date range
|
|
||||||
tags:
|
|
||||||
- task
|
|
||||||
/tasks/bulk:
|
/tasks/bulk:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
|
Loading…
Reference in a new issue