Files
juwan-frontend/lib/api/orders.ts
T

14 lines
406 B
TypeScript

import { useOrderStore } from "@/store/orders"
export function listOrders() {
return useOrderStore.getState().orders
}
export function getOrderById(orderId: string) {
return useOrderStore.getState().orders.find((order) => order.id === orderId)
}
export function listOrdersByConsumer(consumerId: string) {
return useOrderStore.getState().orders.filter((order) => order.consumerId === consumerId)
}