Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function deleteNoteRequest(noteId, cb) {
- fetch(`${Config.API_ENDPOINT}/api/notes/${noteId}`, {
- method: "delete",
- headers: {
- "content-type": "application/json",
- Authorization: `Bearer ${Config.API_KEY}`
- }
- })
- .then(res => {
- if (!res.ok) {
- return res.json().then(error => Promise.reject(error));
- }
- console.log(res.json());
- })
- .then(data => {
- cb(noteId);
- })
- .catch(error => {
- console.error(error);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement