Skip to content

Commit

Permalink
Enhance GetJobsByOrganizationStructureIDs method: preload JobLevel da…
Browse files Browse the repository at this point in the history
…ta for improved job retrieval
  • Loading branch information
IlhamSetiaji committed Dec 23, 2024
1 parent 534d4f5 commit 13cec33
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified go-sso.exe~
Binary file not shown.
2 changes: 1 addition & 1 deletion internal/repository/job_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (r *JobRepository) FindById(id uuid.UUID) (*entity.Job, error) {

func (r *JobRepository) GetJobsByOrganizationStructureIDs(organizationStructureIDs []uuid.UUID) (*[]entity.Job, error) {
var jobs []entity.Job
err := r.DB.Preload("OrganizationStructure.Organization").Where("organization_structure_id IN ?", organizationStructureIDs).Find(&jobs).Error
err := r.DB.Preload("OrganizationStructure.Organization").Preload("OrganizationStructure.JobLevel").Where("organization_structure_id IN ?", organizationStructureIDs).Find(&jobs).Error
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 13cec33

Please sign in to comment.