Derick Montague | fded0d1 | 2019-12-11 06:16:40 -0600 | [diff] [blame] | 1 | import Axios from 'axios'; |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 2 | |
Yoshie Muranaka | 6ce1a07 | 2019-12-06 14:13:59 -0800 | [diff] [blame] | 3 | const api = Axios.create({ |
| 4 | withCredentials: true |
| 5 | }); |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 6 | |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 7 | export default { |
| 8 | get(path) { |
| 9 | return api.get(path); |
| 10 | }, |
| 11 | delete(path, payload) { |
| 12 | return api.delete(path, payload); |
| 13 | }, |
| 14 | post(path, payload) { |
| 15 | return api.post(path, payload); |
| 16 | }, |
| 17 | patch(path, payload) { |
| 18 | return api.patch(path, payload); |
| 19 | }, |
| 20 | put(path, payload) { |
| 21 | return api.put(path, payload); |
| 22 | }, |
| 23 | all(promises) { |
| 24 | return Axios.all(promises); |
Yoshie Muranaka | dc04feb | 2019-12-04 08:41:22 -0800 | [diff] [blame^] | 25 | } |
Yoshie Muranaka | 74c24f1 | 2019-12-03 10:45:46 -0800 | [diff] [blame] | 26 | }; |