gomtm 0.0.263 → 0.0.264
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/mtmFetcher.js
CHANGED
|
@@ -37,6 +37,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
37
|
import { createPromiseClient } from "@connectrpc/connect";
|
|
38
38
|
import { createConnectTransport } from "@connectrpc/connect-web";
|
|
39
39
|
import { merge } from "lodash";
|
|
40
|
+
import { fetchMiddleWithCache } from "mtxlib/http/fetchMiddleWithCache";
|
|
40
41
|
import { MTM_API_PREFIX } from "./consts";
|
|
41
42
|
import { MtmService } from "./gomtmpb/mtm/sppb/mtm_connect";
|
|
42
43
|
const ssrGetBackendUrl = () => {
|
|
@@ -103,7 +104,11 @@ const gomtmFetcher = (initGlobal) => {
|
|
|
103
104
|
"Content-Type": "application/json"
|
|
104
105
|
}, (initGlobal == null ? void 0 : initGlobal.cookieStr) && { "Cookie": initGlobal == null ? void 0 : initGlobal.cookieStr })
|
|
105
106
|
});
|
|
106
|
-
|
|
107
|
+
let fetcher = fetch;
|
|
108
|
+
req.enableCache = true;
|
|
109
|
+
if (req.enableCache) {
|
|
110
|
+
fetcher = fetchMiddleWithCache(fetch);
|
|
111
|
+
}
|
|
107
112
|
try {
|
|
108
113
|
console.info("[mtmfetch]", {
|
|
109
114
|
input,
|