fix: user management & profit chart
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { Orders } from '../../types/services/order'
|
||||
import { Order, Orders } from '../../types/services/order'
|
||||
import { api } from '../api'
|
||||
|
||||
interface OrdersQueryParams {
|
||||
@@ -34,3 +34,13 @@ export function useOrders(params: OrdersQueryParams = {}) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function useOrder(id: string) {
|
||||
return useQuery<Order>({
|
||||
queryKey: ['orders', id],
|
||||
queryFn: async () => {
|
||||
const res = await api.get(`/orders/${id}`)
|
||||
return res.data.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user