Skip to content

Commit

Permalink
Merge pull request #1274 from nfsprodriver/develop
Browse files Browse the repository at this point in the history
Make last_task also accessible on specific template
  • Loading branch information
fiftin committed Jun 17, 2023
2 parents b94cb98 + d589598 commit 86c0394
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions db/Template.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ func FillTemplate(d Store, template *Template) (err error) {
if err != nil {
return
}

var tasks []TaskWithTpl
tasks, err = d.GetTemplateTasks(template.ProjectID, template.ID, RetrieveQueryParams{Count: 1})
if err != nil {
return
}
if len(tasks) > 0 {
template.LastTask = &tasks[0]
}

if template.SurveyVarsJSON != nil {
err = json.Unmarshal([]byte(*template.SurveyVarsJSON), &template.SurveyVars)
Expand Down

0 comments on commit 86c0394

Please sign in to comment.