Törlés
This commit is contained in:
1 parent
0dfccd43d5
commit
71dff33c77
2 files changed
+6
-7
No files matched your search
@@ -107,12 +107,6 @@
|
|||||||
"name": "kotyogós22",
|
"name": "kotyogós22",
|
||||||
"roast": "light",
|
"roast": "light",
|
||||||
"price": "420"
|
"price": "420"
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "2_AY_0pvaU0",
|
|
||||||
"name": "kotyogós33",
|
|
||||||
"roast": "dark",
|
|
||||||
"price": "500"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"$schema": "./node_modules/json-server/schema.json"
|
"$schema": "./node_modules/json-server/schema.json"
|
||||||
|
|||||||
@@ -9,7 +9,12 @@ function Coffee({ coffee }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const torles=(coffee)=>{
|
const torles=(coffee)=>{
|
||||||
//fetch, delete metódussal
|
fetch(`http://localhost:3000/coffees/${coffee.id}`,{
|
||||||
|
method:"DELETE"
|
||||||
|
})
|
||||||
|
.then(res=>res.text())
|
||||||
|
.then(valasz=>alert(valasz))
|
||||||
|
.catch(err=>alert(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in new issue
Block a user