Skip to content

Commit

Permalink
fix: update FindAllView in Item Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
slowhigh committed May 30, 2024
1 parent cf64658 commit dee0614
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions infra/database/repository/item_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ func (clr *ItemRepo) FindAllView(company *string, companySizes *[]entity.Company
param = append(param, fmt.Sprintf("%%%s%%", *company))
}

if companySizes != nil {
if companySizes != nil && len(*companySizes) > 0 {
where = append(where, "company_size IN ?")
param = append(param, *companySizes)
}

if jobTags != nil {
if jobTags != nil && len(*jobTags) > 0 {
where = append(where, "job_tags_id_arr && ?") // `&&`: overlap (have elements in common)
param = append(param, getArrToString(*jobTags))
}

if skillTags != nil {
if skillTags != nil && len(*skillTags) > 0 {
where = append(where, "skill_tags_id_arr && ?") // `&&`: overlap (have elements in common)
param = append(param, getArrToString(*skillTags))
}
Expand Down

0 comments on commit dee0614

Please sign in to comment.