diff --git a/day-04/promise/deleteEmployee.js b/day-04/promise/deleteEmployee.js new file mode 100644 index 0000000..2059ea5 --- /dev/null +++ b/day-04/promise/deleteEmployee.js @@ -0,0 +1,22 @@ +//@author sumeyye karagul + +import fetch from "node-fetch"; + +const id = { + id: 1 +} + +const deleteOneEmployee = async () =>{ + const url = "http://localhost:8080/api/employees/delete/{id}" + return fetch(url, { + method: 'DELETE', + id, + headers :{ + "Content-Type":"application/json" + } + }).then(resp => resp.json) +} + + const result = await deleteOneEmployee(); + + console.log(result) \ No newline at end of file