File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ export default function Home() {
99 const fetchProducts = async ( ) => {
1010 try {
1111 const timestamp = new Date ( ) . getTime ( ) ; // Você pode usar esse timestamp para evitar cache em URL se quiser
12- const res = await api . get < productType [ ] > ( `/product` ) ;
13- const json = res . data
12+ const res = await api . get < productType [ ] > ( `/product` ) ;
13+ const json = res . data ;
1414 setData ( json ) ; // Atualiza o estado com os dados
1515 } catch ( error ) {
1616 console . error ( "Erro ao buscar produtos:" , error ) ;
Original file line number Diff line number Diff line change 22import axios from "axios" ;
33
44export const api = axios . create ( {
5- baseURL : "https://ecommerce-cart-0v1d.onrender.com/ " ,
5+ baseURL : "https://ecommerce-cart-0v1d.onrender.com" ,
66 headers : {
77 "Content-Type" : "application/json" ,
8- Accept : "application/json" ,
9-
10-
8+ Accept : "application/json" ,
9+ 'Cache-Control' : 'no-cache' ,
10+ 'Pragma' : 'no-cache' ,
11+ 'Expires' : '0'
1112 } ,
1213} )
1314api . interceptors . request . use ( ( config ) => {
You can’t perform that action at this time.
0 commit comments