Add copying task task label relations

This commit is contained in:
kolaente 2020-06-29 22:20:28 +02:00
parent 9556bb3918
commit 7e4cd207c2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 15 additions and 1 deletions

View File

@ -122,7 +122,21 @@ func (ld *ListDuplicate) Create(a web.Auth) (err error) {
_ = attachment.File.File.Close()
}
// * Label Tasks (not the labels)
// Copy label tasks (not the labels)
labelTasks := []*LabelTask{}
err = x.In("task_id", oldTaskIDs).Find(&labelTasks)
if err != nil {
return
}
for _, lt := range labelTasks {
lt.ID = 0
lt.TaskID = taskMap[lt.TaskID]
if _, err := x.Insert(lt); err != nil {
return err
}
}
// * assignees
// * comments
// * relations in that list