cookies working for some raeson now
This commit is contained in:
1 parent
413aeedadf
commit
65e603f222
4 files changed
+31
-16
No files matched your search
+18
-7
@@ -1,25 +1,36 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const API_URL = 'http://localhost:41337';
|
||||
|
||||
axios.defaults.withCredentials = true;
|
||||
axios.defaults.crossDomain = true;
|
||||
const api = axios.create({
|
||||
baseURL: 'http://localhost:41337',
|
||||
withCredentials: true
|
||||
});
|
||||
|
||||
const actions = {
|
||||
getBundles: async () => {
|
||||
const { data: bundles } = await axios.get(`${API_URL}/bundles`);
|
||||
const res = await api.get('/bundles');
|
||||
const { data: bundles } = res;
|
||||
console.log(res);
|
||||
return bundles;
|
||||
},
|
||||
|
||||
getUserOffers: async (state, userId) => {
|
||||
const { data: offers } = await axios.get(`${API_URL}/user/${userId}/offers`);
|
||||
const { data: offers } = await api.get(`/user/${userId}/offers`);
|
||||
return offers;
|
||||
},
|
||||
|
||||
getOffers: async (userId) => {
|
||||
const { data } = await axios.get(`${API_URL}/user/${userId}/offers`);
|
||||
const { data } = await api.get(`/user/${userId}/offers`);
|
||||
return data;
|
||||
},
|
||||
|
||||
postLogin: async (email, password) => {
|
||||
const res = await api.post('/auth/login', {
|
||||
email,
|
||||
password,
|
||||
});
|
||||
|
||||
return res.data;
|
||||
},
|
||||
};
|
||||
|
||||
export default actions;
|
||||
Reference in new issue
Block a user