From 416f4f4539a2e6a22b8cb47544c94fb4f77608a1 Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Wed, 30 Oct 2024 20:50:39 +0100 Subject: [PATCH] update to accounting-api --- macros/useMethod.macro.js | 4 ++-- macros/useQuery.macro.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/macros/useMethod.macro.js b/macros/useMethod.macro.js index c9e8c91..95cfe45 100644 --- a/macros/useMethod.macro.js +++ b/macros/useMethod.macro.js @@ -78,10 +78,10 @@ function useMethod({ references, state, babel }) { let useStateHookImport = addNamed(declPath, "useState", "react"); let useCallbackHookImport = addNamed(declPath, "useCallback", "react"); - let servicePath = "./" + path.relative(state.file.opts.filename, path.join(__dirname, "../services/accounting-api")).trim(); + let servicePath = "@services/accounting-api"; let apiErrorImport = addNamed(declPath, "ApiError", servicePath); - let nejServicesPath = "./" + path.relative(path.dirname(state.file.opts.filename), path.join(__dirname, "NejManager/NejProvider")).trim(); + let nejServicesPath = "@utils/NejManager/NejProvider"; let emptyErrorIdentifier = declPath.scope.generateUidIdentifier("emptyErrorInternalMagic") let onErrorIdentifier = declPath.scope.generateUidIdentifier("onErrorInternalMagic") let onSuccessIdentifier = declPath.scope.generateUidIdentifier("onSuccessInternalMagic") diff --git a/macros/useQuery.macro.js b/macros/useQuery.macro.js index a77b702..5f17635 100644 --- a/macros/useQuery.macro.js +++ b/macros/useQuery.macro.js @@ -87,7 +87,7 @@ function useQuery({ references, state, babel }) { } let fullCallPathString = reduceCallee(call.callee) - let servicePath = "./" + path.relative(state.file.opts.filename, path.join(__dirname, "../services/accounting-api")).trim(); + let servicePath = "@services/accounting-api"; let apiErrorImport = addNamed(declPath, "ApiError", servicePath); let useStateSrc = babel.template("[DATA, CALL_SET] = USE_STATE({data: null, error: null, loading: true})")({