Skip to content

Commit 7da20b8

Browse files
PabloJDevmaxzdosreis
authored andcommitted
refactor(produtos): rename Home to useProducts
1 parent 70a7f13 commit 7da20b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

web/src/hooks/api/useProducts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { useEffect, useState } from "react";
1212
price: number;
1313
};
1414

15-
export default function Home() {
15+
export default function useProducts() {
1616
const [products, setProducts] = useState<Product[]>([]);
1717
const [loading, setLoading] = useState(true);
1818
const [error, setError] = useState<string | null>(null);
@@ -24,7 +24,7 @@ import { useEffect, useState } from "react";
2424

2525
console.log("Buscando produtos...");
2626

27-
const res = await fetch("http://localhost:8081/products");
27+
const res = await fetch("http://localhost:8080/products");
2828

2929
if (!res.ok) throw new Error("Erro ao buscar produtos");
3030

0 commit comments

Comments
 (0)