Skip to content

Commit

Permalink
Merge pull request #50 from Xitija/altv1
Browse files Browse the repository at this point in the history
fixed filter issue
  • Loading branch information
snehal0904 authored Mar 16, 2024
2 parents 8c590c5 + d50e5da commit f3d097d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/adapters/hasura/altStudent.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,10 @@ export class ALTStudentService {

Object.keys(studentSearchDto.filters).forEach((e) => {
if (studentSearchDto.filters[e] && studentSearchDto.filters[e] != "") {
if (e === "") {
query += `${e}:{_ilike: "%${studentSearchDto.filters[e]}%"}`;
if (e === "board") {
query += `${e}:{_ilike: "%${studentSearchDto.filters[e]?.ilike}%"}`;
} else {
query += `${e}:{_eq:"${studentSearchDto.filters[e].eq}"}`;
query += `${e}:{_eq:"${studentSearchDto.filters[e]?.eq}"}`;
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions src/adapters/hasura/altTeacher.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,10 @@ export class ALTTeacherService {

Object.keys(teacherSearchDto.filters).forEach((e) => {
if (teacherSearchDto.filters[e] && teacherSearchDto.filters[e] != "") {
if (e === "teacherId") {
query += `${e}:{_eq: "%${teacherSearchDto.filters[e]}%"}`;
if (e === "currentRole" || e === "board") {
query += `${e}:{_ilike:"%${teacherSearchDto.filters[e]?.ilike}%"}`;
} else {
query += `${e}:{_ilike:"${teacherSearchDto.filters[e]}"}`;
query += `${e}:{_eq: "${teacherSearchDto.filters[e]?.eq}"}`;
}
}
});
Expand Down

0 comments on commit f3d097d

Please sign in to comment.