Skip to content

Commit 913f633

Browse files
authored
Merge pull request #6 from sumeyyekaragul/master
delete one employee function has been completed. Many thanks..
2 parents 4b3df6d + 0004b37 commit 913f633

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

day-04/promise/deleteEmployee.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@author sumeyye karagul
2+
3+
import fetch from "node-fetch";
4+
5+
const id = {
6+
id: 1
7+
}
8+
9+
const deleteOneEmployee = async () =>{
10+
const url = "http://localhost:8080/api/employees/delete/{id}"
11+
return fetch(url, {
12+
method: 'DELETE',
13+
id,
14+
headers :{
15+
"Content-Type":"application/json"
16+
}
17+
}).then(resp => resp.json)
18+
}
19+
20+
const result = await deleteOneEmployee();
21+
22+
console.log(result)

0 commit comments

Comments
 (0)