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

Task: Remove redundant get template details call as we already have all the info in the get templates call #33437

Open
rahulbarwal opened this issue May 14, 2024 — with Slack · 3 comments
Assignees
Labels
Task A simple Todo Templates Pod Issues related to Templates Templates Issues related to templates

Comments

Copy link
Contributor

<@U04V0N2K0G1> <@U04LTQU5E8K> I noticed that we are calling the API GET /api/v1/app-templates/{templatedId} when any template is opened in a preview mode. But the get All active templates api/v1/app-templates which is used for rendering the templates homepage has the data available already. Can you guys remove this API call and fetch it from the browser cache?

Slack Message

@rahulbarwal rahulbarwal added Templates Issues related to templates Templates Pod Issues related to Templates labels May 14, 2024 — with Slack
@Nikhil-Nandagopal Nikhil-Nandagopal added the Task A simple Todo label May 14, 2024
@akshayvijayjain
Copy link

akshayvijayjain commented May 17, 2024

@rahulbarwal , are there more details in slack message, as we cannot access it, we are trying to check, if we can pick this up

@saiprabhu-dandanayak
Copy link

saiprabhu-dandanayak commented May 19, 2024

@rahulbarwal , @Nikhil-Nandagopal , i have noticed an API call to GET /api/v1/app-templates/{templateId} when opening a template in preview mode. This seems redundant since the GET /api/v1/app-templates call already has the necessary data.
Could you check if there are more details in the linked Slack message? i am unable to access it and want to see if i can proceed with this task.

@rahulbarwal
Copy link
Contributor Author

@akshayvijayjain , @saiprabhu-dandanayak
Basically when we land on app.appsmith.com we load all templates using /api/v1/app-templates and that list gets stored in redux.

  • Now if a user opens Create new > Templates - a modal with templates open open.
  • If we go to any of templates detail page we make another call to /api/v1/app-templates/{templateId}
  • What we noticed is that this second api call does not send any new information, than already given by request 1 above. Instead we can just filter the existing templates list to get the {templateId}

The second request can be removed completely from the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task A simple Todo Templates Pod Issues related to Templates Templates Issues related to templates
Projects
None yet
Development

No branches or pull requests

5 participants