From c2145b48f549a25a1e963b04050c2e1e0c398baf Mon Sep 17 00:00:00 2001 From: ghost2023 Date: Wed, 3 Jun 2026 15:31:29 +0300 Subject: [PATCH] fix --- .../src/hooks/rule-engine/useRuleEngine.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/edr-freight-web/backoffice/src/hooks/rule-engine/useRuleEngine.ts b/apps/edr-freight-web/backoffice/src/hooks/rule-engine/useRuleEngine.ts index 8430c8f1c..6342d66fb 100644 --- a/apps/edr-freight-web/backoffice/src/hooks/rule-engine/useRuleEngine.ts +++ b/apps/edr-freight-web/backoffice/src/hooks/rule-engine/useRuleEngine.ts @@ -9,6 +9,7 @@ import type { RuleEngineRecord, RuleEngineResourceSlug, } from "@/types/rule-engine"; +import { QUERY_KEYS } from "@/constants/TANSTACK_QUEY_KEY"; const CARGO_TYPE_PARENT_PAGE_SIZE = 500; const CONTAINER_TYPE_OPTIONS_PAGE_SIZE = 500; @@ -46,9 +47,7 @@ export const useCargoTypeParentOptions = (excludeId?: string, enabled = true) => const name = String(row.cargoTypeName ?? "").trim(); const code = String(row.code ?? "").trim(); const label = - name && code - ? `${name} (${code})` - : name || code || String(row.id); + name && code ? `${name} (${code})` : name || code || String(row.id); return { label, value: String(row.id) }; }); return [noneOption, ...parents]; @@ -62,9 +61,12 @@ export const useContainerTypeOptions = (enabled = true) => "select-options", ], queryFn: () => - ruleEngineService.list("container-types", { - page: 1, - pageSize: CONTAINER_TYPE_OPTIONS_PAGE_SIZE, + api.ruleEngine.list.call({ + resource: "container-types", + params: { + page: 1, + pageSize: CONTAINER_TYPE_OPTIONS_PAGE_SIZE, + }, }), enabled, select: (result) => { @@ -123,8 +125,7 @@ export const useRuleEngineMutations = (resource: RuleEngineResourceSlug) => { }); const remove = useMutation({ - mutationFn: (id: string) => - api.ruleEngine.remove.call({ resource, id }), + mutationFn: (id: string) => api.ruleEngine.remove.call({ resource, id }), onSuccess: () => { toast.success("Deleted successfully"); invalidate(); @@ -137,8 +138,7 @@ export const useRuleEngineMutations = (resource: RuleEngineResourceSlug) => { export const useRateWorkflow = () => { const qc = useQueryClient(); - const invalidate = () => - qc.invalidateQueries({ queryKey: listKey("rates") }); + const invalidate = () => qc.invalidateQueries({ queryKey: listKey("rates") }); const submit = useMutation({ mutationFn: (id: string) => api.ruleEngine.submitRate.call({ id }),