appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

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

Open rahulbarwal opened this issue 1 year ago • 1 comments

<@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 avatar May 14 '24 11:05 rahulbarwal

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

akshayvijayjain avatar May 17 '24 09:05 akshayvijayjain

@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.

saiprabhu-dandanayak avatar May 19 '24 15:05 saiprabhu-dandanayak

@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.

rahulbarwal avatar May 20 '24 05:05 rahulbarwal

Hi @rahulbarwal , i have raised PR for this issue could you please assign a review for this .

saiprabhu-dandanayak avatar Jun 04 '24 04:06 saiprabhu-dandanayak

Hey @saiprabhu-dandanayak Thanks for picking this up 🙏 . Can you share the link to your PR? @jacquesikot please review it and take next steps.

rahulbarwal avatar Jun 05 '24 06:06 rahulbarwal

Hi @rahulbarwal ,this is PR for this issue

saiprabhu-dandanayak avatar Jun 05 '24 06:06 saiprabhu-dandanayak