(tasks []queue.Task, res *inventory.ListTaskResult, nodeMap map[int]*ent.Node, hasher hashid.Encoder)
| 106 | } |
| 107 | |
| 108 | func BuildTaskListResponse(tasks []queue.Task, res *inventory.ListTaskResult, nodeMap map[int]*ent.Node, hasher hashid.Encoder) *TaskListResponse { |
| 109 | return &TaskListResponse{ |
| 110 | Pagination: res.PaginationResults, |
| 111 | Tasks: lo.Map(tasks, func(t queue.Task, index int) TaskResponse { |
| 112 | var ( |
| 113 | node *ent.Node |
| 114 | s = t.Summarize(hasher) |
| 115 | ) |
| 116 | |
| 117 | if s.NodeID > 0 { |
| 118 | node = nodeMap[s.NodeID] |
| 119 | } |
| 120 | return *BuildTaskResponse(t, node, hasher) |
| 121 | }), |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func BuildTaskResponse(task queue.Task, node *ent.Node, hasher hashid.Encoder) *TaskResponse { |
| 126 | model := task.Model() |
no test coverage detected