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

POST/PATCH file to API endpoint #7

Merged
merged 19 commits into from
Oct 26, 2024
Merged

POST/PATCH file to API endpoint #7

merged 19 commits into from
Oct 26, 2024

Conversation

andrew-fenton
Copy link
Contributor

@andrew-fenton andrew-fenton commented Oct 19, 2024

Implemented and tested POST API endpoint to insert new translations into database.

Key points:

  • Translations will not be added if translations data does not follow format:
"translations" : [
    {
        "language": "<language>",
         "<original_word>": "<translated_word>",
    },
    ...
]
  • If any translations are being updated using a POST request, no translations will be added to the database. Use PATCH endpoint for updates instead.
  • If any new translation insertion fails, no translations will be added to the database. All previously added translations will be rolled back.

Notes:

  • When an insertion error occurs with one or more of the translations, we return status code 500. How do we deal with the error internally though? Logging?

Copy link
Collaborator

@hriday330 hriday330 left a comment

Choose a reason for hiding this comment

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

Excellent work on the translation file processing and tests

@vassilyp vassilyp changed the title POST file to API endpoint POST/PATCH file to API endpoint Oct 24, 2024
@kevinrczhang kevinrczhang merged commit a4ea373 into main Oct 26, 2024
1 check passed
@andrew-fenton andrew-fenton deleted the process_file_endpoint branch October 26, 2024 03:20
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.

4 participants