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

Adds routes for Skills API #650

Closed
wants to merge 7 commits into from
Closed

Conversation

Mir-SA
Copy link

@Mir-SA Mir-SA commented Aug 3, 2022

The API Contract and Data Model should be finalised before moving ahead with this feature

Description

This feature adds routes, controllers, and models for these endpoints

  • Awarding skill to user /skills/:username
  • Fetching all skills /skills
  • Fetching skills of the user /skills/:username
  • Fetching user/s with a skill /users/skill/:skillName

This feature will help fetch the skills of users dynamically from the backend instead of current mock data on members site. These skill/s will be given to the user from the dashboard site

Closes #455

@Mir-SA
Copy link
Author

Mir-SA commented Aug 5, 2022

@ankushdharkar can you review it?
I've updated model and api contract as well.

@ankushdharkar ankushdharkar self-requested a review August 5, 2022 08:44
@Mir-SA Mir-SA force-pushed the skills-api branch 2 times, most recently from f8a3c27 to 77eceb4 Compare August 13, 2022 09:25
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
routes/skills.js Outdated Show resolved Hide resolved
models/skills.js Outdated Show resolved Hide resolved
models/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
controllers/skills.js Outdated Show resolved Hide resolved
test/integration/skills.test.js Outdated Show resolved Hide resolved
controllers/skills.js Show resolved Hide resolved
controllers/skills.js Show resolved Hide resolved
Comment on lines +303 to +306
const { skillName } = req.params;
const skillWithoutSpecialChar = checkDashUnderscore.test(skillName)
? skillName.replace(checkDashUnderscore, " ")
: skillName;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is some error here, how is that handled?

models/skills.js Show resolved Hide resolved
*/
async function awardSkill(skillData, userName) {
try {
const skillSnapshot = await skillsCollection.add(skillData);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this create multiple records for the same skills?

models/users.js Show resolved Hide resolved
@Mir-SA Mir-SA marked this pull request as draft August 30, 2022 03:48
@prakashchoudhary07
Copy link
Contributor

Closing this as this feature is being built as a stand-alone product, in Skill-tree

https://github.com/Real-Dev-Squad/skill-tree-frontend/
https://github.com/Real-Dev-Squad/skill-tree-backend/

@Mir-SA Mir-SA deleted the skills-api branch September 4, 2024 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants