- The fix is in! Linty fresh and pretty...
This commit is contained in:
@@ -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 = {}) => {
|
||||
|
||||
@@ -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 },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user