Skip to content

Commit

Permalink
Merge pull request #10 from steveruizok/master
Browse files Browse the repository at this point in the history
delete fix
  • Loading branch information
marckrenn authored May 2, 2018
2 parents 54df0e6 + b6346c4 commit 25ccbb9
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 25ccbb9

Please sign in to comment.