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

refactor: splits templates API into list and fetch by id #481

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stalniy
Copy link

@stalniy stalniy commented Nov 18, 2024

  1. Splits templates API into 2: list and getById
  2. Reduces amount of properties for every template in response. It contains only 4 properties that is used on UI:
    • id
    • summary
    • logoUrl
    • name

Not tested. Fixes #102

@stalniy
Copy link
Author

stalniy commented Nov 18, 2024

DO NOT MERGE it. Because very likely it will break template detail page on UI as UI currently does not fetch template by id from API.

@stalniy stalniy force-pushed the refactor/split-templates-api branch 2 times, most recently from f95af47 to 7b67f1a Compare November 18, 2024 20:33
@baktun14
Copy link
Contributor

Thanks for your work!

Sorry if it wasn't in the requirements, but following your comments about the impact on the frontend; I suggest we keep the old /templates api endpoint as-is and create a new one /template-list with your changes. That way it won't affect the frontend and we'll be able to merge your pr without effect and implement it on the frontend in another pr.

@baktun14 baktun14 mentioned this pull request Nov 18, 2024
2 tasks
@stalniy
Copy link
Author

stalniy commented Nov 18, 2024

Probably I could create this extra api endpoints under /v2. To make this evolution more clear from api perspective and at the same time keeping /v1/templates to keep old clients work without issues. Some people also may have cached version of SPA in their browsers (long lived browser tabs), and their version of client app may try to use older API version

@baktun14
Copy link
Contributor

baktun14 commented Nov 18, 2024

Probably I could create this extra api endpoints under /v2. To make this evolution more clear from api perspective and at the same time keeping /v1/templates to keep old clients work without issues. Some people also may have cached version of SPA in their browsers (long lived browser tabs), and their version of client app may try to use older API version

Great suggestion and I discussed this internally, but for the sake of keeping the scope of this pr small, I suggest we just keep the old version and add the 2 new endpoints you added.

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.

Improve templates API
3 participants