Combine functions

This commit is contained in:
Brian Buller 2023-08-23 11:55:45 -05:00
parent dcfd80d082
commit 9ef6c61051
1 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,12 @@ func (projectlist *ProjectList) AddProject(project *Project) {
projectlist.Projects[0] = project
}
// AddProjects adds all passed projects to the list
func (projectlist *ProjectList) AddProjects(projects []*Project) {
projectlist.Projects = append(projectlist.Projects, projects...)
}
func (projectlist *ProjectList) Combine(other *ProjectList) { projectlist.AddProjects(other.Projects) }
// GetProject returns the Project with the given project 'id' form the ProjectList.
// Returns an error if Project could not be found.
func (projectlist *ProjectList) GetProject(id int) (*Project, error) {