feat(trade): wait on colleague order until status is final
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+14
-3
@@ -7,11 +7,22 @@ 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)
|
||||
function customerOrderPrefix() {
|
||||
return `/customer${!userStore.isSingle ? '' : '/single'}`
|
||||
}
|
||||
|
||||
export const createOrder = async (obj: Order): Promise<any> => {
|
||||
return await useAxios.post<Order>(`${customerOrderPrefix()}/order`, obj)
|
||||
}
|
||||
|
||||
export const getPendingColleagueOrder = async (): Promise<any> => {
|
||||
return await useAxios.get(`${customerOrderPrefix()}/order/pending`)
|
||||
}
|
||||
|
||||
export const getColleagueOrderStatus = async (id: number): Promise<any> => {
|
||||
return await useAxios.get(`${customerOrderPrefix()}/order/${id}/status`)
|
||||
}
|
||||
|
||||
export const getOrders = async (tbl: Ref<UnwrapRef<TableInput>>): Promise<TableOutput<Transaction>> => {
|
||||
return await useAxios.post<TableOutput<Order>>(`/customer${!userStore.isSingle ? '' : '/single'}/order/table`, tbl)
|
||||
return await useAxios.post<TableOutput<Order>>(`${customerOrderPrefix()}/order/table`, tbl)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user