Add copying task task label relations
This commit is contained in:
parent
9556bb3918
commit
7e4cd207c2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue