Purchase Detail
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { PurchaseOrders } from '@/types/services/purchaseOrder'
|
||||
import { PurchaseOrder, PurchaseOrders } from '@/types/services/purchaseOrder'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { api } from '../api'
|
||||
|
||||
@@ -39,3 +39,13 @@ export function usePurchaseOrders(params: PurchaseOrderQueryParams = {}) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function usePurchaseOrderById(id: string) {
|
||||
return useQuery<PurchaseOrder>({
|
||||
queryKey: ['purchase-orders', id],
|
||||
queryFn: async () => {
|
||||
const res = await api.get(`/purchase-orders/${id}`)
|
||||
return res.data.data
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user