Fix deleting task relations

While the request body of a DELETE request *can* have data in it, it is not really supported and pretty much undocumented. As such, it doesn't work in all clients and probably broke with recent updates.
This fixes this by moving all parts of the task relation used to identify it in the url.

More Info: https://stackoverflow.com/a/299696/10924593
This commit is contained in:
kolaente 2021-02-18 23:35:20 +01:00
parent 3afedc25f0
commit eb3a945678
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
5 changed files with 92 additions and 47 deletions

View file

@ -392,7 +392,7 @@ func registerAPIRoutes(a *echo.Group) {
},
}
a.PUT("/tasks/:task/relations", taskRelationHandler.CreateWeb)
a.DELETE("/tasks/:task/relations", taskRelationHandler.DeleteWeb)
a.DELETE("/tasks/:task/relations/:relationKind/:otherTask", taskRelationHandler.DeleteWeb)
if config.ServiceEnableTaskAttachments.GetBool() {
taskAttachmentHandler := &handler.WebHandler{