Skip to content

Commit 41a5c41

Browse files
fix: render url
1 parent 49b26ff commit 41a5c41

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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);

src/app/services/api.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
import axios from "axios";
33

44
export 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
})
1314
api.interceptors.request.use((config) => {

0 commit comments

Comments
 (0)