15 lines
335 B
JavaScript
15 lines
335 B
JavaScript
import $axios from "../axios";
|
|
|
|
class OrderService {
|
|
getAll = async (userId) => {
|
|
const response = await $axios.get(`/orders?userId=${userId}`);
|
|
return response.data;
|
|
}
|
|
|
|
create = async (data) => {
|
|
const response = await $axios.post("/orders", data);
|
|
return response.data;
|
|
}
|
|
}
|
|
|
|
export default new OrderService(); |