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

Fixes #559 : Refactor API endpoints into individual files #560

Merged
merged 6 commits into from
May 15, 2024

Conversation

hardik-pratap-singh
Copy link
Contributor


name: Fix for Issue #559
about: Refactored APIs into MVC architecture
labels: priority:medium, enhancement, backend


Describe the PR

Earlier, all the APIs were present in single file called index.js which was really difficult to maintain for the maintainers. Now this PR has divided those endpoints into files and these files contains similar types of endpoints. Also, this PR has separated the names of endpoints along with their implementations in separate folders called routes and controllers respectively.

Steps to test the PR

Modified File : browser-extension/api-server/index.js
New Directory : browser-extension/api-server/routes
New Directory : browser-extension/api-server/controllers

Expected behavior

browser-extension/api-server/routes
image

browser-extension/api-server/controllers
image

Now, browser-extension/api-server/index.js looks something like this :
image

@dennyabrain
Copy link
Contributor

@hardik-pratap-singh This looks great! Since its a big change and we don't have automated tests (something we need to fix) it will take us a while to review this. Give us time till next week to get back to you on this.

@aatmanvaidya aatmanvaidya self-requested a review May 15, 2024 08:18
@aatmanvaidya
Copy link
Collaborator

I have reviewed this PR, things look good to me

Its read to merge

These are the following things I tested on Chrome, Brave and Firefox

  1. Slur Replacement
  2. Slur Crowdsource feature (CRUD)
  3. Right Click and add slur (CRUD)
  4. Preferences Tab
  • Manually add a word to the slur list and upon saving, slur replacement should work for that word
  • The enable/disable slur replacement checkbox
  • Adding email
  • changing language
  1. Reset Account
  2. Data in the Resources tab is also shown correctly!

@dennyabrain things look good to me, can you take a final look and merge the PR

@dennyabrain dennyabrain merged commit a84df6e into tattle-made:main May 15, 2024
3 checks passed
@hardik-pratap-singh hardik-pratap-singh deleted the refactor-apis branch September 20, 2024 04:55
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.

3 participants