Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions day-04/promise/deleteEmployee.js
Original file line number Diff line number Diff line change
@@ -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)