- The fix is in! Linty fresh and pretty...

This commit is contained in:
Mike Fitzpatrick
2019-08-08 16:18:08 -04:00
parent dfc4daf696
commit ebb6f47455
52 changed files with 453 additions and 259 deletions

View File

@@ -45,11 +45,11 @@ const cacheBuster = () => {
};
export const getEndpointUrl = (endpoint) => {
if (!endpoints[endpoint]) {
if (!API_ENDPOINTS[endpoint]) {
throw new Error('Invalid API endpoint specified');
}
return `${API_URL}${endpoints[endpoint]}`; //`${cacheBuster()}`;
return `${API_URL}${API_ENDPOINTS[endpoint]}`; //`${cacheBuster()}`;
};
export const requestGet = (path, queryParams = [], requestOptions = {}) => {

View File

@@ -1,4 +1,4 @@
import { API_ENDPOINTS, requestGet } from './index.js';
import { API_ENDPOINTS, requestGet, requestPost } from './index.js';
export const getEmailAvailability = (email) =>
requestGet(`${API_ENDPOINTS.VALIDATE_SIGNUP_EMAIL}/&{encodeURI(email)}`);
@@ -17,3 +17,10 @@ export const registerNewUser = (user) =>
path: API_ENDPOINTS.USER_SIGNUP,
body: { user },
});
export const setNomDeBid = (id, auth) => (nomDeBid) =>
requestPost({
path: `${API_ENDPOINTS.SET_NOM}/${id}`,
body: { nomDeBid },
requestOptions: { Authorization: auth ? `Bearer ${auth}` : null },
});