Comparing version 1.1.0 to 1.2.0
@@ -70,3 +70,3 @@ { | ||
}, | ||
"version": "1.1.0" | ||
"version": "1.2.0" | ||
} |
@@ -76,2 +76,28 @@ /** | ||
* | ||
* Helpful method for post requests. | ||
* | ||
* @param base | ||
* @param path | ||
* @param options | ||
* @return {Promise} | ||
*/ | ||
put: (base, path, options, headers) => { | ||
return axios(base, "put", path, { data: { ...options } }, headers); | ||
}, | ||
/** | ||
* | ||
* Helpful method for put requests. | ||
* | ||
* @param base | ||
* @param path | ||
* @param options | ||
* @return {Promise} | ||
*/ | ||
post: (base, path, options, headers) => { | ||
return axios(base, "put", path, { data: { ...options } }, headers); | ||
}, | ||
/** | ||
* | ||
* Helpful method for get requests. | ||
@@ -78,0 +104,0 @@ * |
@@ -11,5 +11,5 @@ /** | ||
* | ||
* @param verb {"Get"|"Patch"|"Post"|"Delete"} | ||
* @param verb {"Get"|"Patch"|"Post"|"Delete"|"Put"} | ||
* | ||
* @param {"Fetch"|"Update"|"Create"|"Delete"} | ||
* @param {"Fetch"|"Update"|"Create"|"Delete"|"Put"} | ||
*/ | ||
@@ -26,3 +26,5 @@ export function getReduxActionVerb(verb) { | ||
return "Delete"; | ||
case RestVerbs.Put: | ||
return "Put"; | ||
} | ||
} |
@@ -25,3 +25,5 @@ /** | ||
return RestVerbs.Delete; | ||
case "Put": | ||
return RestVerbs.Put; | ||
} | ||
} |
@@ -56,2 +56,14 @@ /** | ||
put: (path, { payload, meta, onSuccess, onFailure, onFinal }) => { | ||
ReduxNL.dispatch({ | ||
verb: RestVerbs.Put, | ||
path, | ||
payload, | ||
meta, | ||
onSuccess, | ||
onFailure, | ||
onFinal | ||
}); | ||
}, | ||
get: (path, { payload, meta, onSuccess, onFailure, onFinal }) => { | ||
@@ -145,2 +157,16 @@ ReduxNL.dispatch({ | ||
}, | ||
put: (path, { payload, meta }) => { | ||
return new Promise((resolve, reject) => { | ||
ReduxNL.put(path, { | ||
payload, | ||
meta, | ||
onSuccess: action => { | ||
resolve(action); | ||
}, | ||
onFailure: action => { | ||
reject(action); | ||
} | ||
}); | ||
}); | ||
}, | ||
get: (path, { payload, meta }) => { | ||
@@ -198,2 +224,5 @@ return new Promise((resolve, reject) => { | ||
}, | ||
put: (path) => { | ||
return getRequestType(RestVerbs.Put, path); | ||
}, | ||
patch: (path) => { | ||
@@ -215,2 +244,5 @@ return getRequestType(RestVerbs.Patch, path); | ||
}, | ||
post: (path) => { | ||
return getResponseType(RestVerbs.Put, path); | ||
}, | ||
patch: (path) => { | ||
@@ -217,0 +249,0 @@ return getResponseType(RestVerbs.Patch, path); |
@@ -13,2 +13,3 @@ /** | ||
Delete: "Delete", | ||
Put: "Put" | ||
} |
37924
651