mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
refactor(nestjs): landed cost
This commit is contained in:
@@ -163,7 +163,7 @@ export function useBill(id, props) {
|
||||
[t.BILL, id],
|
||||
{ method: 'get', url: `/bills/${id}` },
|
||||
{
|
||||
select: (res) => res.data.bill,
|
||||
select: (res) => res.data,
|
||||
defaultData: {},
|
||||
...props,
|
||||
},
|
||||
@@ -208,7 +208,7 @@ export function useBillPaymentTransactions(id, props) {
|
||||
url: `bills/${id}/payment-transactions`,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data.data,
|
||||
select: (res) => res.data,
|
||||
defaultData: [],
|
||||
...props,
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@ export function useCreateLandedCost(props) {
|
||||
|
||||
return useMutation(
|
||||
([id, values]) =>
|
||||
apiRequest.post(`purchases/landed-cost/bills/${id}/allocate`, values),
|
||||
apiRequest.post(`landed-cost/bills/${id}/allocate`, values),
|
||||
{
|
||||
onSuccess: (res, id) => {
|
||||
// Common invalidate queries.
|
||||
@@ -43,7 +43,7 @@ export function useDeleteLandedCost(props) {
|
||||
|
||||
return useMutation(
|
||||
(landedCostId) =>
|
||||
apiRequest.delete(`purchases/landed-cost/${landedCostId}`),
|
||||
apiRequest.delete(`landed-cost/${landedCostId}`),
|
||||
{
|
||||
onSuccess: (res, id) => {
|
||||
// Common invalidate queries.
|
||||
@@ -62,7 +62,7 @@ export function useLandedCostTransaction(query, props) {
|
||||
[t.LANDED_COST, query],
|
||||
{
|
||||
method: 'get',
|
||||
url: 'purchases/landed-cost/transactions',
|
||||
url: 'landed-cost/transactions',
|
||||
params: { transaction_type: query },
|
||||
},
|
||||
{
|
||||
@@ -81,10 +81,10 @@ export function useLandedCostTransaction(query, props) {
|
||||
export function useBillLocatedLandedCost(id, props) {
|
||||
return useRequestQuery(
|
||||
[t.LANDED_COST_TRANSACTION, id],
|
||||
{ method: 'get', url: `purchases/landed-cost/bills/${id}/transactions` },
|
||||
{ method: 'get', url: `landed-cost/bills/${id}/transactions` },
|
||||
{
|
||||
select: (res) => res.data.transactions,
|
||||
defaultData: {},
|
||||
select: (res) => res.data?.data,
|
||||
defaultData: [],
|
||||
...props,
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user