Commit 11013f4a authored by Shaphen Pangburn's avatar Shaphen Pangburn

[AFP-131 Shaphen Pangburn]: Refactor util files to use baseApuUrl in routes

parent 87738ba0
import axios from 'axios';
import Config from '../config';
export const fetchUserCart = userEmail => {
return axios.get(`13.93.237.130:8084/api/carts/${userEmail}`)
return axios.get(`${Config.baseApiUrl}/api/carts/${userEmail}`)
}
export const createCart = newCart => {
return axios.post(`13.93.237.130:8084/api/carts`, newCart)
return axios.post(`${Config.baseApiUrl}/api/carts`, newCart)
}
export const updateCart = (updatedCart, userEmail) => {
// debugger
return axios.put(`13.93.237.130:8084/api/carts/${userEmail}`, updatedCart)
return axios.put(`${Config.baseApiUrl}/api/carts/${userEmail}`, updatedCart)
}
\ No newline at end of file
import axios from 'axios'
import Config from '../config';
export const sendOrderPost = (order) => {
return axios.post("13.93.237.130:8084/api/orders", order)
return axios.post(`${Config.baseApiUrl}/api/carts/api/orders`, order)
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment