Skip to content

Commit

Permalink
Merge pull request #97 from Samagra-Anamaya/feat-healthchecks
Browse files Browse the repository at this point in the history
fix: search
  • Loading branch information
geeky-abhishek authored Nov 8, 2023
2 parents df220bd + f44fe7f commit 40fc35f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions packages/bff/src/submission/submission.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,17 @@ export class SubmissionService {

async searchSubmissions(villageId: string, text: string) {
try {
let submissions;
if (!Number.isNaN(Number(text))) {
submissions = await this.searchByAadhaar(text, villageId);
} else {
submissions = await this.prisma.$queryRawUnsafe(
`SELECT * FROM "public"."Submission"
// if (!Number.isNaN(Number(text))) {
// submissions = await this.searchByAadhaar(text, villageId);
// } else {
const submissions = await this.prisma.$queryRawUnsafe(
`SELECT * FROM "public"."Submission"
WHERE
"spdpVillageId" = ${villageId} AND (
"submissionData"->>'claimantName' ILIKE '%${text}%' OR "submissionData"->>'landTitleSerialNumber' ILIKE '%${text}%' )
LIMIT 30`,
);
}
);
// }

return { result: { submissions } };
} catch (error) {
Expand Down

0 comments on commit 40fc35f

Please sign in to comment.