fix: make sure labels are always exported as caldav
continuous-integration/drone/pr Build is failing Details

Labels were not added to tasks for requests like /dav/lists/{listId}/{taskId}
This commit is contained in:
cernst 2023-02-27 21:39:23 +01:00
parent 53197b85e3
commit ea0a62fbe2
2 changed files with 14 additions and 1 deletions

View File

@ -548,6 +548,19 @@ func GetTaskSimple(s *xorm.Session, t *Task) (task Task, err error) {
return
}
// GetTask returns a task with extra data
func GetTask(s *xorm.Session, t *Task, a web.Auth) (task Task, err error) {
task = *t
task, err = GetTaskSimple(s, t)
if err != nil {
return
}
taskMap := make(map[int64]*Task, 1)
taskMap[task.ID] = &task
err = addMoreInfoToTasks(s, taskMap, a)
return
}
// GetTasksByIDs returns all tasks for a list of ids
func (bt *BulkTask) GetTasksByIDs(s *xorm.Session) (err error) {
for _, id := range bt.IDs {

View File

@ -210,7 +210,7 @@ func (vcls *VikunjaCaldavListStorage) GetResource(rpath string) (*data.Resource,
// save and override the updated unix date to not break any later etag checks
updated := vcls.task.Updated
task, err := models.GetTaskSimple(s, &models.Task{ID: vcls.task.ID, UID: vcls.task.UID})
task, err := models.GetTask(s, &models.Task{ID: vcls.task.ID, UID: vcls.task.UID}, vcls.user)
if err != nil {
_ = s.Rollback()
if models.IsErrTaskDoesNotExist(err) {