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

Reduce API calls on home page and project details page #1315

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

spwoodcock
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation Update
  • 🎨 Style
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ”₯ Performance Improvements
  • βœ… Test
  • πŸ€– Build
  • πŸ” CI
  • πŸ“¦ Chore (Release)
  • ⏩ Revert

Describe this PR

  • The home page was calling two endpoints to get project summaries and project centroids.
    • Updated the project summaries model to include project centroids.
  • The project detail page was calling three endpoints on load to get project details, task details, task centroids.
    • The task details were already returned under project.tasks key, so I removed the call to /tasks/task-list.
    • The centroids are also returned within the task details .outline_centroid key.
    • I'm not entirely sure what the get_point_on_surface endpoint was for, I think it just returned centroids. I marked it for deletion.

Now both the homepage load and project details load take one API call.

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock added frontend Related to frontend code backend Related to backend code labels Mar 1, 2024
@spwoodcock spwoodcock added this to the FMTM Public Beta milestone Mar 1, 2024
@spwoodcock spwoodcock requested review from nrjadkry and NSUWAL123 March 1, 2024 16:34
@spwoodcock spwoodcock self-assigned this Mar 1, 2024
@spwoodcock spwoodcock merged commit 5dcd774 into development Mar 1, 2024
6 checks passed
@spwoodcock spwoodcock deleted the fix/api-call-optimisations branch March 1, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code frontend Related to frontend code
Projects
Development

Successfully merging this pull request may close these issues.

1 participant