Skip to content

Commit 29c8dff

Browse files
committed
chore: move function
1 parent 292eeb6 commit 29c8dff

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

demo/pkg/subgraphs/projects/src/data/employee.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,13 @@ func GetCompletedTasksByEmployeeId(employeeId int32) []*projects.Task {
347347
}
348348
return tasks
349349
}
350+
351+
// Helper function to get employee by ID
352+
func GetEmployeeByID(id int32) *projects.Employee {
353+
for _, employee := range Employees {
354+
if employee.Id == id {
355+
return employee
356+
}
357+
}
358+
return nil
359+
}

demo/pkg/subgraphs/projects/src/data/milestones.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,6 @@ func GetMilestoneByID(id string) *projects.Milestone {
206206
return nil
207207
}
208208

209-
// Helper function to get employee by ID (this should probably be in employee.go but adding here for convenience)
210-
func GetEmployeeByID(id int32) *projects.Employee {
211-
for _, employee := range Employees {
212-
if employee.Id == id {
213-
return employee
214-
}
215-
}
216-
return nil
217-
}
218-
219209
// Function to populate milestone with its relationships (call this dynamically, not during initialization)
220210
func PopulateMilestoneRelationships(milestone *projects.Milestone) *projects.Milestone {
221211
populatedMilestone := &projects.Milestone{

0 commit comments

Comments
 (0)