Built error section, needs to be on a few pages.

This commit is contained in:
2018-11-25 22:03:38 +11:00
parent 83369773cd
commit 88cd1a9a53
11 changed files with 183 additions and 15 deletions

View File

@ -36,9 +36,16 @@ export const getUrl = request => {
return `/api${slash}${r}`;
}
export const get = async (url, params) => {
export const get = async (url, params, test) => {
url = url || "";
if(process.env.NODE_ENV === 'development') {
console.log('testing mode');
return await new Promise((resolve,reject) => {
setTimeout(e => resolve(test), 1000);
});
}
//Generate URL from query string
let paramString = queryString.stringify(params);
url = getUrl(url);