1
0

fix(views): move bucket update to extra endpoint

BREAKING CHANGE: The bucket id of the task model is now only used internally and will not trigger a change in buckets when updating the task.

This resolves a problem where the task update routine needs to know the view context it is in. Because that's not really what it should be used for, the extra endpoint takes all required parameters and handles the complexity of actually updating the bucket.
This fixes a bug where it was impossible to move a task around between buckets of a saved filter view. In that case, the view of the bucket and the project the task was in would be different, hence the update failed.
This commit is contained in:
kolaente
2024-07-02 16:33:46 +02:00
parent e6ce1251f7
commit 359b07dabb
16 changed files with 743 additions and 350 deletions

View File

@ -870,6 +870,17 @@ definitions:
task_id:
type: integer
type: object
models.TaskBucket:
properties:
bucket_id:
type: integer
project_view_id:
type: integer
task_done:
type: boolean
task_id:
type: integer
type: object
models.TaskCollection:
properties:
filter:
@ -3855,6 +3866,53 @@ paths:
summary: Updates a project view
tags:
- project
/projects/{project}/views/{view}/buckets/{bucket}/tasks:
post:
consumes:
- application/json
description: Updates a task in a bucket
parameters:
- description: Project ID
in: path
name: project
required: true
type: integer
- description: Project View ID
in: path
name: view
required: true
type: integer
- description: Bucket ID
in: path
name: bucket
required: true
type: integer
- description: The id of the task you want to move into the bucket.
in: body
name: taskBucket
required: true
schema:
$ref: '#/definitions/models.TaskBucket'
produces:
- application/json
responses:
"200":
description: The updated task bucket.
schema:
$ref: '#/definitions/models.TaskBucket'
"400":
description: Invalid task bucket object provided.
schema:
$ref: '#/definitions/web.HTTPError'
"500":
description: Internal error
schema:
$ref: '#/definitions/models.Message'
security:
- JWTKeyAuth: []
summary: Update a task bucket
tags:
- task
/projects/{projectID}/duplicate:
put:
consumes: