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
+
1
3
function serialize ( obj , prefix ) {
2
4
if ( ! obj ) {
3
5
return '' ;
@@ -17,7 +19,7 @@ function serialize(obj, prefix) {
17
19
18
20
// Return Promise for a url json get request
19
21
export function getJson ( url , params ) {
20
- return fetch (
22
+ return fetchWithErrors (
21
23
encodeURI ( url ) +
22
24
( params ? ( url . search ( / \? / ) === - 1 ? '?' : '&' ) + serialize ( params ) : '' ) ,
23
25
{
@@ -33,7 +35,7 @@ export function getJson(url, params) {
33
35
34
36
// Return Promise for a json post request
35
37
export function postJson ( url , params , payload ) {
36
- return fetch (
38
+ return fetchWithErrors (
37
39
encodeURI ( url ) +
38
40
( params ? ( url . search ( / \? / ) === - 1 ? '?' : '&' ) + serialize ( params ) : '' ) ,
39
41
{
You can’t perform that action at this time.
0 commit comments