fix(PM-4288): Query fix on completed profiles count#61
Conversation
| ) | ||
| ) | ||
| AND ( | ||
| $2::boolean IS NULL |
There was a problem hiding this comment.
[correctness]
The condition $2::boolean IS NULL OR (...) = $2::boolean could lead to unexpected behavior if $2 is not strictly a boolean or null. Ensure that $2 is always a boolean or null to avoid potential issues.
| OR ( | ||
| ( | ||
| mtp.value::jsonb ? 'availability' | ||
| AND btrim(mtp.value->>'availability') <> '' |
There was a problem hiding this comment.
[correctness]
Using btrim(mtp.value->>'availability') <> '' assumes that availability is always a string. If availability can be other types (e.g., null or a non-string type), this could lead to runtime errors. Consider adding a type check or ensuring the data type consistency.
| ? Number(row.skillCount) | ||
| : undefined, | ||
| principalSkills: row.principalSkills || undefined, | ||
| openToWork: row.openToWork ?? null, |
There was a problem hiding this comment.
[💡 style]
Consider using undefined instead of null for openToWork to maintain consistency with other properties in the mapped object, which use undefined for missing values.
| : undefined, | ||
| principalSkills: row.principalSkills || undefined, | ||
| openToWork: row.openToWork ?? null, | ||
| isOpenToWork: row.isOpenToWork ?? false, |
There was a problem hiding this comment.
[correctness]
The default value for isOpenToWork is set to false. Ensure this aligns with the intended logic, as it might affect filtering or display logic elsewhere in the application.
What's in this PR?