Comments, appointments adjustments, fixed some issues
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
//Base path for all cart API calls
|
||||
const BASE = "/api/v1/cart";
|
||||
|
||||
//Returns the standard headers needed for authenticated requests
|
||||
function authHeaders(token) {
|
||||
return {
|
||||
"Content-Type": "application/json",
|
||||
@@ -7,6 +9,7 @@ function authHeaders(token) {
|
||||
};
|
||||
}
|
||||
|
||||
//Parses the response and throws an error if the request failed
|
||||
async function handleResponse(res) {
|
||||
if (res.status === 204) return null;
|
||||
const data = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user