Skip to content
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

Update the URL for saving skills #1583

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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', {})
}