mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
fix(be): sql query
This commit is contained in:
parent
21ba6c6b64
commit
24bc4a83b8
@ -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
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, tsk := range tasks {
|
||||
if tsk.ID != *tpl.LastTaskID {
|
||||
continue
|
||||
}
|
||||
|
||||
err = tsk.Fill(d)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
template.LastTask = &tsk
|
||||
break
|
||||
}
|
||||
templates = append(templates, template)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user