1
0

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:
konrad
2020-08-01 16:54:38 +00:00
parent 0ba6ae7a18
commit e4539ef232
7 changed files with 109 additions and 45 deletions

View File

@ -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