diff --git a/modules/customer-invoices/src/web/proformas/shared/hooks/use-proforma-update-mutation.ts b/modules/customer-invoices/src/web/proformas/shared/hooks/use-proforma-update-mutation.ts index 9d800ae8..b40e31f9 100644 --- a/modules/customer-invoices/src/web/proformas/shared/hooks/use-proforma-update-mutation.ts +++ b/modules/customer-invoices/src/web/proformas/shared/hooks/use-proforma-update-mutation.ts @@ -9,10 +9,7 @@ import { updateProformaById } from "../api"; import type { Proforma } from "../entities"; import { UPDATE_PROFORMA_MUTATION_KEY } from "./keys"; -import { - invalidateProformaListQueries, - syncUpdatedProformaCaches, -} from "./proforma-cache-strategy"; +import { syncUpdatedProformaCaches } from "./proforma-cache-strategy"; import { toValidationErrors } from "./to-validation-errors"; type UpdateProformaContext = {}; @@ -36,17 +33,11 @@ export const useProformaUpdateMutation = () => { throw new ValidationErrorCollection("Validation failed", toValidationErrors(result.error)); } - const dto: UpdateProformaByIdResult = await updateProformaById( - dataSource, - params as UpdateProformaByIdParams - ); + const dto: UpdateProformaByIdResult = await updateProformaById(dataSource, params); return GetProformaByIdAdapter.fromDto(dto); }, onSuccess: async (proforma) => { await syncUpdatedProformaCaches(queryClient, proforma); }, - onSettled: async () => { - await invalidateProformaListQueries(queryClient); - }, }); }; diff --git a/modules/customers/src/web/shared/hooks/use-customer-update-mutation.ts b/modules/customers/src/web/shared/hooks/use-customer-update-mutation.ts index 037e13bc..34c3c2fb 100644 --- a/modules/customers/src/web/shared/hooks/use-customer-update-mutation.ts +++ b/modules/customers/src/web/shared/hooks/use-customer-update-mutation.ts @@ -11,10 +11,7 @@ import { } from "../api"; import type { Customer } from "../entities"; -import { - invalidateCustomerListQueries, - syncUpdatedCustomerCaches, -} from "./customer-cache-strategy"; +import { syncUpdatedCustomerCaches } from "./customer-cache-strategy"; import { CUSTOMER_UPDATE_KEY } from "./keys"; import { toValidationErrors } from "./to-validation-errors"; @@ -39,18 +36,12 @@ export const useCustomerUpdateMutation = () => { throw new ValidationErrorCollection("Validation failed", toValidationErrors(result.error)); } - const dto: UpdateCustomerByIdResult = await updateCustomerById( - dataSource, - params as UpdateCustomerByIdParams - ); + const dto: UpdateCustomerByIdResult = await updateCustomerById(dataSource, params); return GetCustomerByIdAdapter.fromDTO(dto); }, onSuccess: (updatedCustomer) => { syncUpdatedCustomerCaches(queryClient, updatedCustomer); }, - onSettled: async () => { - await invalidateCustomerListQueries(queryClient); - }, }); }; diff --git a/modules/supplier/src/web/shared/hooks/use-supplier-update-mutation.ts b/modules/supplier/src/web/shared/hooks/use-supplier-update-mutation.ts index b9f6f3bb..2d700ea3 100644 --- a/modules/supplier/src/web/shared/hooks/use-supplier-update-mutation.ts +++ b/modules/supplier/src/web/shared/hooks/use-supplier-update-mutation.ts @@ -12,10 +12,7 @@ import { import type { Supplier } from "../entities"; import { SUPPLIER_UPDATE_KEY } from "./keys"; -import { - invalidateSupplierListQueries, - syncUpdatedSupplierCaches, -} from "./supplier-cache-strategy"; +import { syncUpdatedSupplierCaches } from "./supplier-cache-strategy"; import { toValidationErrors } from "./to-validation-errors"; type UpdateSupplierContext = {}; @@ -39,19 +36,12 @@ export const useSupplierUpdateMutation = () => { throw new ValidationErrorCollection("Validation failed", toValidationErrors(result.error)); } - const dto: UpdateSupplierByIdResult = await updateSupplierById( - dataSource, - params as UpdateSupplierByIdParams - ); + const dto: UpdateSupplierByIdResult = await updateSupplierById(dataSource, params); return GetSupplierByIdAdapter.fromDTO(dto); }, onSuccess: (updatedSupplier) => { syncUpdatedSupplierCaches(queryClient, updatedSupplier); }, - - onSettled: async () => { - await invalidateSupplierListQueries(queryClient); - }, }); };