Use db sessions for task-related things (#621)
Use db sessions for task-related things Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/621
This commit is contained in:
@ -120,8 +120,10 @@ func (ld *ListDuplicate) Create(a web.Auth) (err error) {
|
||||
t.ListID = ld.List.ID
|
||||
t.BucketID = bucketMap[t.BucketID]
|
||||
t.UID = ""
|
||||
err := createTask(t, a, false)
|
||||
s := x.NewSession()
|
||||
err := createTask(s, t, a, false)
|
||||
if err != nil {
|
||||
_ = s.Rollback()
|
||||
return err
|
||||
}
|
||||
taskMap[oldID] = t.ID
|
||||
|
Reference in New Issue
Block a user