Closed jmgasper closed 8 months ago
@jmgasper
I get this error when calling update skills in manager app(pls allow https://local.topcoder-dev.com in allow origin cors):
I get this error when calling update skills in postman: example body:
{
"workId": "fe775295-1f41-49c8-a946-b9004ced24fe",
"workTypeId": "413340e8-f56f-4061-8796-c916dfa82770",
"skillIds": [
"041573a9-3713-4dbd-ad6d-db5dd2857783"
]
}
@suppermancool - Try /emsi-skills/work-skills
, instead of /emsi-skills-work-skills
, thanks. The CORS is in place for local.topcoder-dev.com, so it should be fixed with the updated URL.
@jmgasper I get this error with the new endpoint:
@jmgasper I saw emsi and I was thinking you're trying to reach the old api, but after the slack comment, I think you're trying to hit the standardized skills api.
You should use /v5/standardized-skills/work-skills
. this is the correct url, the payload looks good. You can also use the postman/swagger files hosted in this repo: https://github.com/topcoder-platform/standardized-skills-api/tree/develop/docs.
cc @suppermancool
@vas3a - Ugh, my bad, thanks for that. Just wasn't paying attention.
@jmgasper @vas3a
I got the backend error Job with id: fe775295-1f41-49c8-a946-b9004ced24fe does not exist!
with payload:
{
"workId": "fe775295-1f41-49c8-a946-b9004ced24fe",
"workTypeId": "413340e8-f56f-4061-8796-c916dfa82770",
"skillIds": [
"002015b4-9bcb-4b85-9d46-e648d0375a54"
]
}
I got the backend error Skill(s) to be associated do not exist!
with payload:
{
"workId": "fe775295-1f41-49c8-a946-b9004ced24fe",
"workTypeId": "413340e8-f56f-4061-8796-c916dfa82770",
"skillIds": [
"1780cf93-e193-419e-9f95-6dd05dc86a74"
]
}
skills
in challenge details
info(response of get {{API_V5}}/challenges/fe775295-1f41-49c8-a946-b9004ced24fe)? Because I can not save the skills now I do not know the template of skills in the backend response. I do not have permission to assess https://github.com/topcoder-platform/standardized-skills-api/tree/develop/docs@suppermancool - A couple things here:
The work type ID should be 4d2bdbc8-eb3b-4156-8d20-98a46589cc5d
, sorry. That whole thing is a bit confusing and I had to dig it out of the database. I'm thinking we may want a lookup API for it. I've attached the full list below, for reference on later tickets.
I still get an error with that:
{
"message": "Challenge with id: fe775295-1f41-49c8-a946-b9004ced24fe does not exist!"
}
I'll have to ask the platform devs on why that's not finding the challenge.
@suppermancool - Ok, the platform team fixed the API. I was able to create a skill on a challenge with this POST:
{
"workId": "fe775295-1f41-49c8-a946-b9004ced24fe",
"workTypeId": "4d2bdbc8-eb3b-4156-8d20-98a46589cc5d",
"skillIds": [
"002015b4-9bcb-4b85-9d46-e648d0375a54"
]
}
@jmgasper there is one problem. I can not save skills with skill ID from https://api.topcoder-dev.com/v5/emsi-skills/skills/auto-complete?term=jav . However, that bug does not block me from finishing this task.
@suppermancool - We should be using https://api.topcoder-dev.com/v5/standardized-skills/skills/autocomplete?term=jav instead. That will have the correct IDs returned.
NOTE - autocomplete
in the new API instead of auto-complete
@jmgasper done in work-manager-issue-1575.patch (this patch against commit 073fa1fb984c547d486bdfa8f13e6ab71c4f7ddc in develop branch)
@jmgasper pls apply this patch after the above patch work-manager-issue-1575-2.patch (i forget to check the creating challenge flow)
@suppermancool - OK, I think we found one bug here. When saving a challenge, we need to:
/work-skills
, all in one go, instead of every time the user edits a skill in the selector.What's happening is that the skills are being saved to '/work-skills', but then we save the challenge to the challenge API and because it doesn't contain any skills, they get cleared out.
@jmgasper i implement your suggestion in work-manager-issue-1575-3.patch (this patch against commit bd2768e7c50975684e9d9d0d0000bc3102da9421 in develop branch)
POST /standardized-skills/work-skills
API and the backend returns success, but after fetching challenge info I do not see the skills(no skills field in challenge info response), that used to work before. I think that is the reason the skills keep getting cleared out, there is nothing wrong with the frontend flow @suppermancool - Thanks, we're working on this.
@suppermancool - Ok, after a lot of back and forth, we need to tweak all requests to the challenge API to include a version header like:
challenge-api-version
: 1.1.0
Then, the skills will be returned in the GET
to the challenge API.
Example Postman setup:
@jmgasper done in work-manager-issue-1575-4.patch (this patch against commit 88b229efc540138b3b52ae2affad1c9bb0282611 in develop branch)
There are three parts to this task:
Part 1
We want to change the skill auto-complete endpoint from
/v5/tc-emsi-skills-api
to/v5/emsi-skills/skills
Example:
https://api.topcoder-dev.com/v5/emsi-skills/skills/auto-complete?term=jav
Part 2
We can now save the skills back to the API when editing a challenge. This will require a second API call when saving a challenge, which we'll need to make sure happens in addition to the
PUT
to the challenge endpoint.To save skills:
POST to
https://api.topcoder-dev.com/v5/emsi-skills-work-skills
BODY:
The
workId
is the challenge IDThe
workTypeId
should be configurable, with the default being413340e8-f56f-4061-8796-c916dfa82770
Part 3
When reading the skills to display on the challenge details page, we can continue to use the challenge API response, but we should be looking for the
skills
array, notemsi-skills
.