-
Notifications
You must be signed in to change notification settings - Fork 0
fix(PM-4288): Query fix on completed profiles count #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,15 @@ WHERE m.description IS NOT NULL | |
| AND jsonb_array_length(mtp.value::jsonb -> 'preferredRoles') > 0 | ||
| ) | ||
| ) | ||
| AND ( | ||
| $2::boolean IS NULL | ||
| OR ( | ||
| ( | ||
| mtp.value::jsonb ? 'availability' | ||
| AND btrim(mtp.value->>'availability') <> '' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| ) = $2::boolean | ||
| ) | ||
| ) | ||
| ) | ||
| AND EXISTS ( | ||
| SELECT 1 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,8 @@ type CompletedProfileRow = { | |
| city: string | null; | ||
| skillCount: string | number | null; | ||
| principalSkills: string[] | null; | ||
| isOpenToWork?: boolean | null; | ||
| openToWork?: { availability?: string; preferredRoles?: string[] } | null; | ||
| }; | ||
|
|
||
| type CompletedProfilesCountRow = { | ||
|
|
@@ -699,6 +701,8 @@ export class TopcoderReportsService { | |
| ? Number(row.skillCount) | ||
| : undefined, | ||
| principalSkills: row.principalSkills || undefined, | ||
| openToWork: row.openToWork ?? null, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
| isOpenToWork: row.isOpenToWork ?? false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| })); | ||
|
|
||
| return { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[⚠️
correctness]The condition
$2::boolean IS NULL OR (...) = $2::booleancould lead to unexpected behavior if$2is not strictly a boolean or null. Ensure that$2is always a boolean or null to avoid potential issues.