Avengers042 / petshop-frontend

https://e-pet.vercel.app
0 stars 0 forks source link

Integrate CEP services to application #3

Open victor4pinheiro opened 1 year ago

victor4pinheiro commented 1 year ago

At this moment, we don't have any CEP service to fill empty inputs in product registration. I propose that we study CEP services (I really suggest Correios Web Services) and try to implement considering this challenges:

  1. Using possibly two tokens: one for login and another for CEP.
  2. Token need to be in browser's cache to avoid unneeded requisitions.

What's your thoughts, @wesleyclaudino ?

wesleyclaudino commented 1 year ago

I didn't find where in the post office API would return zip code data, I found another one from ViaCep that returns location data from zip code. In this case, it would not be necessary to use a token, just persist in cookies or localStorage.

https://viacep.com.br/ws/{cep}/json

victor4pinheiro commented 1 year ago

Got it. For a while, I don't think I'll be able to dedicate time to frontend because I need to speed up backend development. For now, I believe I can do some validations, but the rest is up to you. If you think you can implement API service in frontend after finishing the main priorities, ok.