Skip to content

Commit

Permalink
Update the URL for saving skills
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgasper committed Nov 20, 2023
1 parent 0760c78 commit 2dfe14c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
3 changes: 1 addition & 2 deletions config/constants/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,5 @@ module.exports = {
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main`,
SKILLS_V5_API_URL: `${API_V5}/standardized-skills/skills/autocomplete`,
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/work-skills`,
WORK_TYPE_ID: '4d2bdbc8-eb3b-4156-8d20-98a46589cc5d'
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/challenge-skills`
}
3 changes: 1 addition & 2 deletions config/constants/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@ module.exports = {
HEADER_AUTH_URLS_HREF: `https://accounts-auth0.${DOMAIN}?utm_source=community-app-main`,
HEADER_AUTH_URLS_LOCATION: `https://accounts-auth0.${DOMAIN}?retUrl=%S&utm_source=community-app-main`,
SKILLS_V5_API_URL: `${API_V5}/standardized-skills/skills/autocomplete`,
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/work-skills`,
WORK_TYPE_ID: '4d2bdbc8-eb3b-4156-8d20-98a46589cc5d'
UPDATE_SKILLS_V5_API_URL: `${API_V5}/standardized-skills/challenge-skills`
}
12 changes: 6 additions & 6 deletions src/actions/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import {
LOAD_CHALLENGE_RESOURCES_SUCCESS,
LOAD_CHALLENGE_RESOURCES_PENDING,
LOAD_CHALLENGE_RESOURCES_FAILURE,
WORK_TYPE_ID,
UPDATE_CHALLENGES_SKILLS_SUCCESS
} from '../config/constants'
import { loadProject } from './projects'
Expand Down Expand Up @@ -746,11 +745,12 @@ export function updateChallengeSkills (challengeId, skills) {
if (!skills) {
return
}
await updateChallengeSkillsApi({
workId: challengeId,
workTypeId: WORK_TYPE_ID,
skillIds: skills.map(skill => skill.id)
})
await updateChallengeSkillsApi(
challengeId,
{
skillIds: skills.map(skill => skill.id)
}
)
dispatch({
type: UPDATE_CHALLENGES_SKILLS_SUCCESS,
payload: skills
Expand Down
3 changes: 1 addition & 2 deletions src/config/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export const {
API_V4,
API_V5,
SKILLS_V5_API_URL,
UPDATE_SKILLS_V5_API_URL,
WORK_TYPE_ID
UPDATE_SKILLS_V5_API_URL
} = process.env
export const CREATE_FORUM_TYPE_IDS = typeof process.env.CREATE_FORUM_TYPE_IDS === 'string' ? process.env.CREATE_FORUM_TYPE_IDS.split(',') : process.env.CREATE_FORUM_TYPE_IDS

Expand Down
4 changes: 2 additions & 2 deletions src/services/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export async function deleteResource (resource) {
* @param {Object} skills data
* @returns {Promise<*>}
*/
export async function updateChallengeSkillsApi (skills) {
const resp = await axiosInstance.post(UPDATE_SKILLS_V5_API_URL, skills)
export async function updateChallengeSkillsApi (challengeId, skills) {
const resp = await axiosInstance.post(`${UPDATE_SKILLS_V5_API_URL}/${challengeId}`, skills)
return _.get(resp, 'data', {})
}

0 comments on commit 2dfe14c

Please sign in to comment.