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})")({