-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix duplicate handling in update questions backend #140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Only a minor nitpick
@@ -39,14 +39,22 @@ async def delete_question(question_id: str): | |||
|
|||
async def update_question_by_id(question_id: str, question_data: UpdateQuestionModel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be difficult to identify what this function returns. Currently, it can return None
, str
and QuestionModel
which may make it difficult to understand the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we need some form error handling for this and other end points too. Instead of returning None
/str
, should throw error instead
Previously, the update question endpoint failed to check for duplicate title in the database, allowing for duplicates titles to be stored in the database.
Changes made