Purchase Detail

This commit is contained in:
efrilm
2025-09-13 03:50:57 +07:00
parent e1084277e0
commit 2d3274d3bf
5 changed files with 128 additions and 184 deletions
+11 -1
View File
@@ -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
}
})
}