2025-10-05 09:44:14 +03:30
|
|
|
import useAxios from "@/utils/useAxios";
|
|
|
|
|
import type {Order} from "@/models/order";
|
|
|
|
|
import type {TableInput, TableOutput} from "@/models/table";
|
|
|
|
|
import type {Ref, UnwrapRef} from "vue";
|
|
|
|
|
import type {Transaction} from "@/models/transaction";
|
|
|
|
|
import {useUserStore} from "@/store/userStore";
|
|
|
|
|
|
|
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
|
|
|
|
export const createOrder = async (obj: Order): Promise<any> => {
|
|
|
|
|
return await useAxios.post<Order>(`/customer${!userStore.isSingle ? '' : '/single'}/order`, obj)
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-28 11:17:48 +03:30
|
|
|
|
2025-10-05 09:44:14 +03:30
|
|
|
export const getOrders = async (tbl: Ref<UnwrapRef<TableInput>>): Promise<TableOutput<Transaction>> => {
|
|
|
|
|
return await useAxios.post<TableOutput<Order>>(`/customer${!userStore.isSingle ? '' : '/single'}/order/table`, tbl)
|
|
|
|
|
}
|