1
0

Add bulk edit for tasks (#42)

This commit is contained in:
konrad
2018-12-28 21:49:46 +00:00
committed by Gitea
parent b050132f4f
commit 3814b8a504
16 changed files with 862 additions and 20 deletions

View File

@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2018-12-25 21:44:18.815676554 +0100 CET m=+0.161606284
// 2018-12-28 01:18:16.824999107 +0100 CET m=+0.098072896
package docs
@ -2133,6 +2133,68 @@ var doc = `{
}
}
},
"/tasks/bulk": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Updates a bunch of tasks at once. This includes marking them as done. Note: although you could supply another ID, it will be ignored. Use task_ids instead.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Update a bunch of tasks at once",
"parameters": [
{
"description": "The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update.",
"name": "task",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.BulkTask"
}
}
],
"responses": {
"200": {
"description": "The updated task object.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.ListTask"
}
},
"400": {
"description": "Invalid task object provided.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
}
},
"403": {
"description": "The user does not have access to the task (aka its list)",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io.web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/tasks/caldav": {
"get": {
"security": [
@ -2947,6 +3009,72 @@ var doc = `{
}
}
},
"models.BulkTask": {
"type": "object",
"properties": {
"created": {
"type": "integer"
},
"createdBy": {
"type": "object",
"$ref": "#/definitions/models.User"
},
"description": {
"type": "string"
},
"done": {
"type": "boolean"
},
"dueDate": {
"type": "integer"
},
"endDate": {
"type": "integer"
},
"id": {
"type": "integer"
},
"listID": {
"type": "integer"
},
"parentTaskID": {
"type": "integer"
},
"priority": {
"type": "integer"
},
"reminderDates": {
"type": "array",
"items": {
"type": "integer"
}
},
"repeatAfter": {
"type": "integer"
},
"startDate": {
"type": "integer"
},
"subtasks": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ListTask"
}
},
"task_ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"text": {
"type": "string"
},
"updated": {
"type": "integer"
}
}
},
"models.EmailConfirm": {
"type": "object",
"properties": {

View File

@ -21,6 +21,8 @@ This document describes the different errors Vikunja can return.
| 3005 | 400 | The list title cannot be empty. |
| 4001 | 400 | The list task text cannot be empty. |
| 4002 | 404 | The list task does not exist. |
| 4003 | 403 | All bulk editing tasks must belong to the same list. |
| 4004 | 403 | Need at least one task when bulk editing tasks. |
| 5001 | 404 | The namspace does not exist. |
| 5003 | 403 | The user does not have access to the specified namespace. |
| 5006 | 400 | The namespace name cannot be empty. |

View File

@ -2120,6 +2120,68 @@
}
}
},
"/tasks/bulk": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Updates a bunch of tasks at once. This includes marking them as done. Note: although you could supply another ID, it will be ignored. Use task_ids instead.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"task"
],
"summary": "Update a bunch of tasks at once",
"parameters": [
{
"description": "The task object. Looks like a normal task, the only difference is it uses an array of list_ids to update.",
"name": "task",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.BulkTask"
}
}
],
"responses": {
"200": {
"description": "The updated task object.",
"schema": {
"type": "object",
"$ref": "#/definitions/models.ListTask"
}
},
"400": {
"description": "Invalid task object provided.",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
}
},
"403": {
"description": "The user does not have access to the task (aka its list)",
"schema": {
"type": "object",
"$ref": "#/definitions/code.vikunja.io/web.HTTPError"
}
},
"500": {
"description": "Internal error",
"schema": {
"type": "object",
"$ref": "#/definitions/models.Message"
}
}
}
}
},
"/tasks/caldav": {
"get": {
"security": [
@ -2933,6 +2995,72 @@
}
}
},
"models.BulkTask": {
"type": "object",
"properties": {
"created": {
"type": "integer"
},
"createdBy": {
"type": "object",
"$ref": "#/definitions/models.User"
},
"description": {
"type": "string"
},
"done": {
"type": "boolean"
},
"dueDate": {
"type": "integer"
},
"endDate": {
"type": "integer"
},
"id": {
"type": "integer"
},
"listID": {
"type": "integer"
},
"parentTaskID": {
"type": "integer"
},
"priority": {
"type": "integer"
},
"reminderDates": {
"type": "array",
"items": {
"type": "integer"
}
},
"repeatAfter": {
"type": "integer"
},
"startDate": {
"type": "integer"
},
"subtasks": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ListTask"
}
},
"task_ids": {
"type": "array",
"items": {
"type": "integer"
}
},
"text": {
"type": "string"
},
"updated": {
"type": "integer"
}
}
},
"models.EmailConfirm": {
"type": "object",
"properties": {

View File

@ -11,6 +11,50 @@ definitions:
username:
type: string
type: object
models.BulkTask:
properties:
created:
type: integer
createdBy:
$ref: '#/definitions/models.User'
type: object
description:
type: string
done:
type: boolean
dueDate:
type: integer
endDate:
type: integer
id:
type: integer
listID:
type: integer
parentTaskID:
type: integer
priority:
type: integer
reminderDates:
items:
type: integer
type: array
repeatAfter:
type: integer
startDate:
type: integer
subtasks:
items:
$ref: '#/definitions/models.ListTask'
type: array
task_ids:
items:
type: integer
type: array
text:
type: string
updated:
type: integer
type: object
models.EmailConfirm:
properties:
token:
@ -1822,6 +1866,50 @@ paths:
summary: Get tasks sorted and within a date range
tags:
- task
/tasks/bulk:
post:
consumes:
- application/json
description: 'Updates a bunch of tasks at once. This includes marking them as
done. Note: although you could supply another ID, it will be ignored. Use
task_ids instead.'
parameters:
- description: The task object. Looks like a normal task, the only difference
is it uses an array of list_ids to update.
in: body
name: task
required: true
schema:
$ref: '#/definitions/models.BulkTask'
type: object
produces:
- application/json
responses:
"200":
description: The updated task object.
schema:
$ref: '#/definitions/models.ListTask'
type: object
"400":
description: Invalid task object provided.
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
"403":
description: The user does not have access to the task (aka its list)
schema:
$ref: '#/definitions/code.vikunja.io/web.HTTPError'
type: object
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
type: object
security:
- ApiKeyAuth: []
summary: Update a bunch of tasks at once
tags:
- task
/tasks/caldav:
get:
description: Returns a calDAV-parsable format with all tasks as calendar events.