flowrix 1.0.1-beta.27 → 1.0.1-beta.29
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/module.json
CHANGED
|
@@ -177,7 +177,7 @@ export default function (): {
|
|
|
177
177
|
CheckUserAccount(email: string): Promise<any>;
|
|
178
178
|
saveToCheckoutSession(fieldsData: import("../../stores/index.js").FieldData): Promise<void>;
|
|
179
179
|
}>;
|
|
180
|
-
countries: any
|
|
180
|
+
countries: import("vue").Ref<any, any>;
|
|
181
181
|
BillingDetailsForm: any;
|
|
182
182
|
DeliveryMethodForm: any;
|
|
183
183
|
ShippingDetailsForm: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export interface Country {
|
|
2
|
+
code: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
import { AsyncData } from '#app';
|
|
6
|
+
export declare const useCountry: () => AsyncData<any, any>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { useAsyncData } from "#app";
|
|
1
2
|
export const useCountry = () => {
|
|
2
|
-
const { data, error, refresh, execute } = useAsyncData(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
refresh,
|
|
9
|
-
execute
|
|
10
|
-
};
|
|
3
|
+
const { data, error, refresh, execute } = useAsyncData(
|
|
4
|
+
"countries",
|
|
5
|
+
() => $fetch("/api/checkout/countries"),
|
|
6
|
+
{ server: true }
|
|
7
|
+
);
|
|
8
|
+
return { data, error, refresh, execute };
|
|
11
9
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useRuntimeConfig } from "nuxt/app";
|
|
1
2
|
const isServer = typeof process !== "undefined" && process.server;
|
|
2
3
|
function getEnv(key) {
|
|
3
4
|
try {
|
|
@@ -10,12 +11,12 @@ function getEnv(key) {
|
|
|
10
11
|
}
|
|
11
12
|
async function request(method, endpoint, options = {}, apiversion) {
|
|
12
13
|
console.log("checkt useRuntimeConfig", typeof useRuntimeConfig === "function");
|
|
13
|
-
const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY")
|
|
14
|
-
const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET")
|
|
15
|
-
const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN")
|
|
16
|
-
let FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE")
|
|
14
|
+
const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY");
|
|
15
|
+
const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET");
|
|
16
|
+
const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN");
|
|
17
|
+
let FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE");
|
|
17
18
|
if (apiversion == "v2") {
|
|
18
|
-
FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE_V2")
|
|
19
|
+
FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE_V2");
|
|
19
20
|
}
|
|
20
21
|
const headers = {
|
|
21
22
|
"x-api-key": FLOWRIX_API_KEY,
|