Skip to content

Commit

Permalink
fix(be): sql query
Browse files Browse the repository at this point in the history
  • Loading branch information
fiftin committed Jul 21, 2024
1 parent 21ba6c6 commit 24bc4a8
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions db/sql/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,20 @@ func (d *SqlDb) GetTemplates(projectID int, filter db.TemplateFilter, params db.

for _, tpl := range tpls {
template := tpl.Template
if tpl.LastTaskID == nil {
continue
}

for _, tsk := range tasks {
if tsk.ID != *tpl.LastTaskID {
continue
}

err = tsk.Fill(d)
if err != nil {
return
if tpl.LastTaskID != nil {
for _, tsk := range tasks {
if tsk.ID == *tpl.LastTaskID {
err = tsk.Fill(d)
if err != nil {
return
}
template.LastTask = &tsk
break
}
}
template.LastTask = &tsk
break
}

templates = append(templates, template)
}

Expand Down

0 comments on commit 24bc4a8

Please sign in to comment.