auth init
This commit is contained in:
1 parent
faa2e70e08
commit
413aeedadf
29 files changed
+2854
-649
No files matched your search
+16
-8
@@ -1,17 +1,25 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const actions = store => ({
|
||||
const API_URL = 'http://localhost:41337';
|
||||
|
||||
axios.defaults.withCredentials = true;
|
||||
axios.defaults.crossDomain = true;
|
||||
|
||||
const actions = {
|
||||
getBundles: async () => {
|
||||
const { data: bundles } = await axios.get('http://localhost:41337/bundles');
|
||||
return { bundles };
|
||||
const { data: bundles } = await axios.get(`${API_URL}/bundles`);
|
||||
return bundles;
|
||||
},
|
||||
|
||||
getUserOffers: async (state, userId) => {
|
||||
store.setState({ offers: [] });
|
||||
const { data: offers } = await axios.get(`http://localhost:41337/user/${userId}/offers`);
|
||||
console.log(userId, offers);
|
||||
return { offers };
|
||||
const { data: offers } = await axios.get(`${API_URL}/user/${userId}/offers`);
|
||||
return offers;
|
||||
},
|
||||
});
|
||||
|
||||
getOffers: async (userId) => {
|
||||
const { data } = await axios.get(`${API_URL}/user/${userId}/offers`);
|
||||
return data;
|
||||
},
|
||||
};
|
||||
|
||||
export default actions;
|
||||
Reference in new issue
Block a user