Skip to content

Commit 85e23c9

Browse files
authored
Update api.js
1 parent 193f18a commit 85e23c9

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

api.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
const API_URL = 'http://localhost:8080'; //url do app, vou add dps
22

33
export const productService = {
4-
// Listar produtos
54
async getProducts() {
65
const response = await fetch(`${API_URL}/products`);
76
return response.json();
87
},
98

10-
// Criar produto
119
async createProduct(product) {
1210
const response = await fetch(`${API_URL}/products`, {
1311
method: 'POST',
@@ -19,13 +17,11 @@ export const productService = {
1917
return response.json();
2018
},
2119

22-
// Buscar produto por ID
2320
async getProduct(id) {
2421
const response = await fetch(`${API_URL}/products/${id}`);
2522
return response.json();
2623
},
2724

28-
// Atualizar produto
2925
async updateProduct(id, product) {
3026
const response = await fetch(`${API_URL}/products/${id}`, {
3127
method: 'PUT',
@@ -37,7 +33,6 @@ export const productService = {
3733
return response.json();
3834
},
3935

40-
// Deletar produto
4136
async deleteProduct(id) {
4237
await fetch(`${API_URL}/products/${id}`, {
4338
method: 'DELETE',

0 commit comments

Comments
 (0)