From b6346c4cf803383ca5884fd884b47f438a131352 Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Tue, 1 May 2018 23:26:01 +0100 Subject: [PATCH] delete fix Was leaving out the method for DELETE. This fixes the problem. --- firebase.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/firebase.coffee b/firebase.coffee index e5dd3a3..e33918c 100644 --- a/firebase.coffee +++ b/firebase.coffee @@ -46,13 +46,15 @@ class exports.Firebase extends Framer.BaseClass console.log "Firebase: New '#{method}'-request with data: '#{JSON.stringify(data)}' \n URL: '#{url}'" if debug - options = if data? - body: JSON.stringify(data) + options = method: method headers: 'content-type': 'application/json; charset=utf-8' - r = fetch url, (options ? {}) + if data? + options.body = JSON.stringify(data) + + r = fetch(url, options) .then (res) -> if !res.ok then throw Error(res.statusText) json = res.json()