-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fallback for homepage positions to use additional skill codes #1126
Conversation
@@ -633,4 +635,3 @@ export const HOME_PAGE_RECOMMENDED_POSITIONS = PropTypes.shape({ | |||
positions: PropTypes.arrayOf(POSITION_DETAILS), | |||
name: PropTypes.string, | |||
}); | |||
|
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.
😢
FEATURED_GRADE_POSITIONS, | ||
FEATURED_POSITIONS } from '../Constants/PropTypes'; | ||
|
||
const specialNeedsParams = SPECIAL_NEEDS.join(','); | ||
|
||
// Export our queries so that we can consistently test them. | ||
export const GET_RECOMMENDED_GRADE_AND_SKILL_CODE_POSITIONS_QUERY = (skillCodes, grade) => `/fsbid/available_positions/?position__skill__code__in=${skillCodes}&position__grade__code__in=${grade}&limit=3`; | ||
export const GET_RECOMMENDED_GRADE_AND_SKILL_CONE_POSITIONS_QUERY = (skillCodes, grade) => `/fsbid/available_positions/?position__skill__code__in=${skillCodes}&position__grade__code__in=${grade}&limit=3`; |
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.
I know technically this doesn't matter, but would it be better for readability to change these, and the ones on line 24&25, from skillCodes
to skillCones
?
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.
The naming was tricky because we're still technically sending in skillCodes, even though we're referring to it as skillCones. I think I'll leave it as is because of that.
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.
oh yeaa! Thank makes sense
@@ -93,11 +102,13 @@ export function homePageFeaturedPositionsFetchData(skills = [], grade) { | |||
.then((results) => { | |||
let shouldSkip = false; | |||
// if our query returned no results, we will want to fall to the next arrangement | |||
if (isEmpty(results.data) && queryType.name !== 'featuredPositions') { | |||
if (isEmpty(results.data) && queryType.name !== FEATURED_POSITIONS) { |
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.
👍 noice
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.
🍬 🍭 🍰 🥮 👍 it's beautiful!
Use with MetaPhase-Consulting/State-TalentMAP-API#417
Uses skill codes that fall in the skill cones of the user's skill codes as additional search criteria for homepage position fallbacks.