Task Comments (#138)
Add swagger docs Add integration tests Add tests Add task comment test fixtures Add config option to enable/disable task comments Add custom error if a task comment does not exist Fix lint Add getting author when getting a single comment Fix getting comments/comments author Add rights check to ReadAll + actually get the comment author Add migration and table definitions Add routes Add ReadOne method Add basic crud rights Signed-off-by: kolaente <k@knt.li> Implement basic crudable functions for task comments Signed-off-by: kolaente <k@knt.li> Start adding task comments Signed-off-by: kolaente <k@knt.li> Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/138
This commit is contained in:
@ -305,6 +305,19 @@ func registerAPIRoutes(a *echo.Group) {
|
||||
a.GET("/tasks/:task/attachments/:attachment", apiv1.GetTaskAttachment)
|
||||
}
|
||||
|
||||
if config.ServiceEnableTaskComments.GetBool() {
|
||||
taskCommentHandler := &handler.WebHandler{
|
||||
EmptyStruct: func() handler.CObject {
|
||||
return &models.TaskComment{}
|
||||
},
|
||||
}
|
||||
a.GET("/tasks/:task/comments", taskCommentHandler.ReadAllWeb)
|
||||
a.PUT("/tasks/:task/comments", taskCommentHandler.CreateWeb)
|
||||
a.DELETE("/tasks/:task/comments/:commentid", taskCommentHandler.DeleteWeb)
|
||||
a.POST("/tasks/:task/comments/:commentid", taskCommentHandler.UpdateWeb)
|
||||
a.GET("/tasks/:task/comments/:commentid", taskCommentHandler.ReadOneWeb)
|
||||
}
|
||||
|
||||
labelHandler := &handler.WebHandler{
|
||||
EmptyStruct: func() handler.CObject {
|
||||
return &models.Label{}
|
||||
|
Reference in New Issue
Block a user