File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1+ import { fetchWithErrors } from './fetchUtils' ;
2+
13function serialize ( obj , prefix ) {
24 if ( ! obj ) {
35 return '' ;
@@ -17,7 +19,7 @@ function serialize(obj, prefix) {
1719
1820// Return Promise for a url json get request
1921export function getJson ( url , params ) {
20- return fetch (
22+ return fetchWithErrors (
2123 encodeURI ( url ) +
2224 ( params ? ( url . search ( / \? / ) === - 1 ? '?' : '&' ) + serialize ( params ) : '' ) ,
2325 {
@@ -33,7 +35,7 @@ export function getJson(url, params) {
3335
3436// Return Promise for a json post request
3537export function postJson ( url , params , payload ) {
36- return fetch (
38+ return fetchWithErrors (
3739 encodeURI ( url ) +
3840 ( params ? ( url . search ( / \? / ) === - 1 ? '?' : '&' ) + serialize ( params ) : '' ) ,
3941 {
You can’t perform that action at this time.
0 commit comments