- implementing immutable.js
This commit is contained in:
@@ -3,9 +3,11 @@ const apiUrl = 'http://localhost:3001';
|
||||
const endpoints = {
|
||||
// Events and Items
|
||||
GET_EVENTS: '/events',
|
||||
GET_ITEMS: '/items?eventId=:event_id',
|
||||
// GET_ITEMS: '/items?eventId=:event_id',
|
||||
GET_ITEMS: '/items',
|
||||
|
||||
// Auction Interactions
|
||||
// GET_STATUS: '/auction/:event_id',
|
||||
GET_STATUS: '/auction',
|
||||
PLACE_BID: '/bids/:item_id',
|
||||
PURCHASE_ITEM: '/sales',
|
||||
@@ -30,8 +32,8 @@ const cacheBuster = () => {
|
||||
|
||||
export const getEndpointUrl = (endpoint) => {
|
||||
if (!endpoints[endpoint]) {
|
||||
return throw new Error('Invalid API endpoint specified');
|
||||
throw new Error('Invalid API endpoint specified');
|
||||
}
|
||||
|
||||
return `${apiUrl}${endpoints[endpoint]}${cacheBuster()}`;
|
||||
return `${apiUrl}${endpoints[endpoint]}`; //`${cacheBuster()}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user