feat(trade): wait on colleague order until status is final

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-02 15:55:08 +03:30
co-authored by Cursor
parent 164bb267f1
commit 0d19412c96
6 changed files with 222 additions and 15 deletions
+14 -3
View File
@@ -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)
}