Open noctera opened 1 year ago
@luwol03 I have updated the route response
what about making groupId and languagePackagId optional and have one controller handler?
what about making groupId and languagePackagId optional and have one controller handler?
Yeah this was my intention I tried to explain here
For a better overview I have split up the two needed cases. But overall there is only one endpoint, where you can give your needed query parameters to get the result. This includes adding groupId and packageId in one query too (although this is a bit useless).
Or did you think of something else
oh ok. And what is with the third case without any parameters?
I don't know if not parameters make that much sense. No parameters would mean that it checks in every group and package. But I think you only need this function to check a specific package, not all your packages
I was thinking of showing that this vocab already exists in package XXX group XXX
@luwol03 I have added a vocab parameter to the route, as it is a GET. Would you agree with this?
What should this be for? And I would also respond with the found vocab so you can show it in the create anyway dialog.
I was thinking of showing that this vocab already exists in package XXX group XXX
Yeah understand what you mean. But when you create a new package you usually don't care if a vocab you want to add is already existing in another package, as it is completely new and created for another learning purpose. I think a global check would be unnecessary and disturbing
What should this be for? And I would also respond with the found vocab so you can show it in the create anyway dialog.
The vocab
parameter includes the name (foreign word) that has to be checked. As this is a GET request I wouldn't send it in the body.
Yeah you could add the found vocab I'm the response. But you could just use the foreign word of the input field in the client that is saved there anyways
We need a route to checki if vocab already exists in groups/packages when creating them. The check only has do be done client-side, so no additional checking in the vocab creation functions.
Needed Routes:
/api/check-duplicate?languagePackageId={languagePackageId}&vocab={vocab}
Response:
/api/check-duplicate?groupId={groupId}&vocab={vocab}
Response:
For a better overview I have split up the two needed cases. But overall there is only one endpoint, where you can give your needed query parameters to get the result. This includes adding groupId and packageId in one query too (although this is a bit useless).