@websolutespa/bom-mixer-store 1.0.0 → 1.0.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @websolutespa/bom-mixer-store
2
2
 
3
- ## 0.4.0
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixing: localhost url.
8
+
9
+ ## 1.0.0
4
10
 
5
11
  ### Minor Changes
6
12
 
package/dist/index.js CHANGED
@@ -106,7 +106,7 @@ function getApiUrl(pathname) {
106
106
  const localUrl = process.env.NEXT_PUBLIC_URL === "https://" ? process.env.NEXT_PUBLIC_MOCK_FALLBACK_URL : process.env.NEXT_PUBLIC_URL;
107
107
  const apiBase = process.env.NEXT_PUBLIC_API || "/api";
108
108
  const url = `${localUrl}${apiBase}${pathname}`;
109
- return url;
109
+ return url.replace("://localhost", "://127.0.0.1");
110
110
  }
111
111
  async function apiFetch(pathname, options = {}, serviceOptions) {
112
112
  const url = new URL(getApiUrl(pathname));
@@ -923,7 +923,7 @@ function getApiUrl2(pathname) {
923
923
  } else {
924
924
  url = `${MOCK_API_URL}${MOCK_API_BASE}/_mock${pathname}`;
925
925
  }
926
- return url;
926
+ return url.replace("://localhost", "://127.0.0.1");
927
927
  }
928
928
  async function storeApiFetch(pathname, options = {}) {
929
929
  const url = getApiUrl2(pathname);
package/dist/index.mjs CHANGED
@@ -45,7 +45,7 @@ function getApiUrl(pathname) {
45
45
  const localUrl = process.env.NEXT_PUBLIC_URL === "https://" ? process.env.NEXT_PUBLIC_MOCK_FALLBACK_URL : process.env.NEXT_PUBLIC_URL;
46
46
  const apiBase = process.env.NEXT_PUBLIC_API || "/api";
47
47
  const url = `${localUrl}${apiBase}${pathname}`;
48
- return url;
48
+ return url.replace("://localhost", "://127.0.0.1");
49
49
  }
50
50
  async function apiFetch(pathname, options = {}, serviceOptions) {
51
51
  const url = new URL(getApiUrl(pathname));
@@ -870,7 +870,7 @@ function getApiUrl2(pathname) {
870
870
  } else {
871
871
  url = `${MOCK_API_URL}${MOCK_API_BASE}/_mock${pathname}`;
872
872
  }
873
- return url;
873
+ return url.replace("://localhost", "://127.0.0.1");
874
874
  }
875
875
  async function storeApiFetch(pathname, options = {}) {
876
876
  const url = getApiUrl2(pathname);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-store",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Mixer Store module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -26,7 +26,7 @@ export function getApiUrl(pathname: string): string {
26
26
  'url', url,
27
27
  );
28
28
  */
29
- return url;
29
+ return url.replace('://localhost', '://127.0.0.1');
30
30
  }
31
31
 
32
32
  export async function apiFetch<T = any>(pathname: string, options: FetchRequestOptions = {}, serviceOptions?: { locale: string, market: string }): Promise<T> {
@@ -24,7 +24,7 @@ function getApiUrl(pathname: string): string {
24
24
  } else {
25
25
  url = `${MOCK_API_URL}${MOCK_API_BASE}/_mock${pathname}`;
26
26
  }
27
- return url;
27
+ return url.replace('://localhost', '://127.0.0.1');
28
28
  }
29
29
 
30
30
  export async function storeApiFetch(pathname: string, options: ApiRequestOptions = {}): Promise<any> {