rails-request-json
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -9,4 +9,5 @@ import { FetchRequest } from '@rails/request.js' | ||
return request.perform().then(response => { | ||
if(response.statusCode === 204) return '' | ||
return response.json() | ||
if(response.response.headers.get('Content-Length') > 0) { | ||
return response.json | ||
} | ||
}) | ||
@@ -19,4 +20,4 @@ } | ||
const patch = (url, payload) => makeRequest('patch', url, payload) | ||
const destroy = (url, payload) => makeRequest('destroy', url, payload) | ||
const destroy = (url, payload) => makeRequest('delete', url, payload) | ||
export { get, post, put, patch, destroy } |
{ | ||
"name": "rails-request-json", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "JSON shorthand functions for @rails/request.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1009
18