Check cpic action.

This commit is contained in:
Drew Larson
2017-05-23 19:30:44 -06:00
parent e061320ee7
commit d748deb178
4 changed files with 39 additions and 65 deletions
@@ -58,6 +58,23 @@ const Api = {
throw error;
});
},
cpicBike(id) {
fetch(`/api/v1/bikes/${id}/check/`, {
credentials: 'same-origin',
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfToken,
},
})
.then(checkStatus)
.then(parseJson)
.then(data => data)
.catch((error) => {
console.log('request failed', error);
throw error;
});
}
};
export default Api;