Skip to content

Commit

Permalink
delete fix
Browse files Browse the repository at this point in the history
Was leaving out the method for DELETE. This fixes the problem.
  • Loading branch information
steveruizok committed May 1, 2018
1 parent 7273b9f commit b6346c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions firebase.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b6346c4

Please sign in to comment.