flowrix 1.0.1-beta.70 → 1.0.1-beta.72
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 +1 -1
- package/dist/module.mjs +12 -0
- package/dist/runtime/composables/Customer/useRegister.js +9 -9
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.js +1 -0
- package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
- package/dist/runtime/composables/useQuotationCheckout.js +138 -0
- package/dist/runtime/server/api/checkout/paymentmethod.js +7 -7
- package/dist/runtime/server/api/checkout/quotation/[slug].d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/[slug].js +21 -0
- package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +37 -0
- package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/guest/customer.js +21 -0
- package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
- package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +23 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -166,6 +166,18 @@ const module$1 = defineNuxtModule({
|
|
|
166
166
|
route: "/api/checkout/paymentmethod",
|
|
167
167
|
handler: resolver.resolve("./runtime/server/api/checkout/paymentmethod")
|
|
168
168
|
});
|
|
169
|
+
addServerHandler({
|
|
170
|
+
route: "/api/checkout/quotation/guest/:slug",
|
|
171
|
+
handler: resolver.resolve("./runtime/server/api/checkout/quotation/guest/[slug]")
|
|
172
|
+
});
|
|
173
|
+
addServerHandler({
|
|
174
|
+
route: "/api/checkout/quotation/submit/:slug",
|
|
175
|
+
handler: resolver.resolve("./runtime/server/api/checkout/quotation/submit/[slug]")
|
|
176
|
+
});
|
|
177
|
+
addServerHandler({
|
|
178
|
+
route: "/api/checkout/quotation/:slug",
|
|
179
|
+
handler: resolver.resolve("./runtime/server/api/checkout/quotation/[slug]")
|
|
180
|
+
});
|
|
169
181
|
addServerHandler({
|
|
170
182
|
route: "/api/company/profile",
|
|
171
183
|
handler: resolver.resolve("./runtime/server/api/company/profile")
|
|
@@ -163,17 +163,17 @@ export default function(countries) {
|
|
|
163
163
|
inputData.value.shipping_mobile = inputData.value.billing_mobile;
|
|
164
164
|
}
|
|
165
165
|
await CustomerRegister(inputData.value);
|
|
166
|
-
if (regResponse.value.status !== "Success") {
|
|
166
|
+
if (!regResponse.value || regResponse.value.status !== "Success") {
|
|
167
167
|
let errorMsg = "Registration failed. Please try again.";
|
|
168
|
-
if (regResponse.value
|
|
168
|
+
if (regResponse.value?.message) {
|
|
169
169
|
if (typeof regResponse.value.message === "string") {
|
|
170
170
|
errorMsg = regResponse.value.message;
|
|
171
|
-
} else if (
|
|
172
|
-
const fieldErrors = Object.entries(regResponse.value.message).flatMap(
|
|
173
|
-
([field, errors]) => (errors || []).map((err) => `${field.charAt(0).toUpperCase() + field.slice(1)}: ${err}`)
|
|
174
|
-
);
|
|
171
|
+
} else if (typeof regResponse.value.message === "object") {
|
|
172
|
+
const fieldErrors = Object.entries(regResponse.value.message).flatMap(([field, errors]) => (errors || []).map((err) => `${field.charAt(0).toUpperCase() + field.slice(1)}: ${err}`));
|
|
175
173
|
errorMsg = fieldErrors.length > 0 ? fieldErrors.join("\n") : errorMsg;
|
|
176
174
|
}
|
|
175
|
+
} else if (!regResponse.value) {
|
|
176
|
+
errorMsg = "No response received from server. Please try again.";
|
|
177
177
|
}
|
|
178
178
|
displayAlert(errorMsg, "danger");
|
|
179
179
|
isLoading.value = false;
|
|
@@ -183,9 +183,9 @@ export default function(countries) {
|
|
|
183
183
|
email: inputData.value.email,
|
|
184
184
|
password: inputData.value.password
|
|
185
185
|
};
|
|
186
|
-
await
|
|
187
|
-
if (logResponse.value.status !== "Success") {
|
|
188
|
-
const errorMsg = typeof logResponse.value.message === "string" ? logResponse.value.message : "Login failed after registration. Please try logging in manually.";
|
|
186
|
+
logResponse.value = await useAuthStore().userLogin(loginCredentials);
|
|
187
|
+
if (!logResponse.value || logResponse.value.status !== "Success") {
|
|
188
|
+
const errorMsg = !logResponse.value ? "No login response received." : typeof logResponse.value.message === "string" ? logResponse.value.message : "Login failed after registration. Please try logging in manually.";
|
|
189
189
|
displayAlert(errorMsg, "danger");
|
|
190
190
|
isLoading.value = false;
|
|
191
191
|
return;
|
|
@@ -71,6 +71,7 @@ export { useClientApi } from './useClientApi.js';
|
|
|
71
71
|
export { useDynamicHtmlRenderer } from './useDynamicHtmlRenderer.js';
|
|
72
72
|
export { useLocation } from './useLocation.js';
|
|
73
73
|
export { useLocations } from './useLocations.js';
|
|
74
|
+
export { useQuotationCheckout } from './useQuotationCheckout.js';
|
|
74
75
|
export { useSearch } from './useSearch.js';
|
|
75
76
|
export { useSubscriptions } from './useSubscriptions.js';
|
|
76
77
|
export { useWebforms } from './useWebforms.js';
|
|
@@ -71,6 +71,7 @@ export { useClientApi } from "./useClientApi.js";
|
|
|
71
71
|
export { useDynamicHtmlRenderer } from "./useDynamicHtmlRenderer.js";
|
|
72
72
|
export { useLocation } from "./useLocation.js";
|
|
73
73
|
export { useLocations } from "./useLocations.js";
|
|
74
|
+
export { useQuotationCheckout } from "./useQuotationCheckout.js";
|
|
74
75
|
export { useSearch } from "./useSearch.js";
|
|
75
76
|
export { useSubscriptions } from "./useSubscriptions.js";
|
|
76
77
|
export { useWebforms } from "./useWebforms.js";
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const useQuotationCheckout: () => {
|
|
2
|
+
inputData: import("vue").Ref<{
|
|
3
|
+
paymentmethod: string;
|
|
4
|
+
customertoken: string;
|
|
5
|
+
authoritytoleave: undefined;
|
|
6
|
+
register: string;
|
|
7
|
+
password: string;
|
|
8
|
+
password_confirmation: string;
|
|
9
|
+
passwordStrengthValue: string;
|
|
10
|
+
customernotes: string;
|
|
11
|
+
ewayKey: string;
|
|
12
|
+
eway_cardname: string;
|
|
13
|
+
eway_cardnumber: string;
|
|
14
|
+
eway_expirymonth: string;
|
|
15
|
+
eway_expiryyear: string;
|
|
16
|
+
eway_cvn: string;
|
|
17
|
+
till_cardname: string;
|
|
18
|
+
till_cardnumber: string;
|
|
19
|
+
till_cvn: string;
|
|
20
|
+
till_expirymonth: string;
|
|
21
|
+
till_expiryyear: string;
|
|
22
|
+
save_card_details: number;
|
|
23
|
+
}, {
|
|
24
|
+
paymentmethod: string;
|
|
25
|
+
customertoken: string;
|
|
26
|
+
authoritytoleave: undefined;
|
|
27
|
+
register: string;
|
|
28
|
+
password: string;
|
|
29
|
+
password_confirmation: string;
|
|
30
|
+
passwordStrengthValue: string;
|
|
31
|
+
customernotes: string;
|
|
32
|
+
ewayKey: string;
|
|
33
|
+
eway_cardname: string;
|
|
34
|
+
eway_cardnumber: string;
|
|
35
|
+
eway_expirymonth: string;
|
|
36
|
+
eway_expiryyear: string;
|
|
37
|
+
eway_cvn: string;
|
|
38
|
+
till_cardname: string;
|
|
39
|
+
till_cardnumber: string;
|
|
40
|
+
till_cvn: string;
|
|
41
|
+
till_expirymonth: string;
|
|
42
|
+
till_expiryyear: string;
|
|
43
|
+
save_card_details: number;
|
|
44
|
+
} | {
|
|
45
|
+
paymentmethod: string;
|
|
46
|
+
customertoken: string;
|
|
47
|
+
authoritytoleave: undefined;
|
|
48
|
+
register: string;
|
|
49
|
+
password: string;
|
|
50
|
+
password_confirmation: string;
|
|
51
|
+
passwordStrengthValue: string;
|
|
52
|
+
customernotes: string;
|
|
53
|
+
ewayKey: string;
|
|
54
|
+
eway_cardname: string;
|
|
55
|
+
eway_cardnumber: string;
|
|
56
|
+
eway_expirymonth: string;
|
|
57
|
+
eway_expiryyear: string;
|
|
58
|
+
eway_cvn: string;
|
|
59
|
+
till_cardname: string;
|
|
60
|
+
till_cardnumber: string;
|
|
61
|
+
till_cvn: string;
|
|
62
|
+
till_expirymonth: string;
|
|
63
|
+
till_expiryyear: string;
|
|
64
|
+
save_card_details: number;
|
|
65
|
+
}>;
|
|
66
|
+
publishableKey: import("vue").Ref<any, any>;
|
|
67
|
+
responseData: import("vue").Ref<any, any>;
|
|
68
|
+
QuotationData: import("vue").Ref<any, any>;
|
|
69
|
+
checkoutSession: import("vue").Ref<any, any>;
|
|
70
|
+
preference: import("vue").Ref<any, any>;
|
|
71
|
+
errorResponseData: import("vue").Ref<any, any>;
|
|
72
|
+
resetState: () => void;
|
|
73
|
+
getQuotation: (slug: string) => Promise<any>;
|
|
74
|
+
getGuestQuotation: (slug: string, query?: any) => Promise<any>;
|
|
75
|
+
GuestCheckoutQuotation: (slug: string, quotationData: any, query?: any) => Promise<any>;
|
|
76
|
+
paymentMethods: (formData: any) => Promise<any>;
|
|
77
|
+
submitCheckout: (slug: string, quotationData: any) => Promise<unknown>;
|
|
78
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
export const useQuotationCheckout = () => {
|
|
3
|
+
const publishableKey = ref({});
|
|
4
|
+
const responseData = ref([]);
|
|
5
|
+
const QuotationData = ref([]);
|
|
6
|
+
const checkoutSession = ref([]);
|
|
7
|
+
const preference = ref({ data: { fields: {} } });
|
|
8
|
+
const errorResponseData = ref([]);
|
|
9
|
+
const inputData = ref({
|
|
10
|
+
paymentmethod: "",
|
|
11
|
+
customertoken: "",
|
|
12
|
+
authoritytoleave: void 0,
|
|
13
|
+
register: "",
|
|
14
|
+
password: "",
|
|
15
|
+
password_confirmation: "",
|
|
16
|
+
passwordStrengthValue: "",
|
|
17
|
+
customernotes: "",
|
|
18
|
+
ewayKey: "",
|
|
19
|
+
eway_cardname: "",
|
|
20
|
+
eway_cardnumber: "",
|
|
21
|
+
eway_expirymonth: "",
|
|
22
|
+
eway_expiryyear: "",
|
|
23
|
+
eway_cvn: "",
|
|
24
|
+
till_cardname: "",
|
|
25
|
+
till_cardnumber: "",
|
|
26
|
+
till_cvn: "",
|
|
27
|
+
till_expirymonth: "",
|
|
28
|
+
till_expiryyear: "",
|
|
29
|
+
save_card_details: 0
|
|
30
|
+
});
|
|
31
|
+
const resetState = () => {
|
|
32
|
+
publishableKey.value = {};
|
|
33
|
+
responseData.value = [];
|
|
34
|
+
checkoutSession.value = [];
|
|
35
|
+
preference.value = [];
|
|
36
|
+
errorResponseData.value = [];
|
|
37
|
+
};
|
|
38
|
+
const getQuotation = async (slug) => {
|
|
39
|
+
try {
|
|
40
|
+
const response = await $fetch(`/api/checkout/quotation/${slug}`, {
|
|
41
|
+
method: "GET"
|
|
42
|
+
});
|
|
43
|
+
if (response) {
|
|
44
|
+
publishableKey.value = response.data;
|
|
45
|
+
QuotationData.value = response;
|
|
46
|
+
}
|
|
47
|
+
return response;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
errorResponseData.value = error.data || error;
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const getGuestQuotation = async (slug, query) => {
|
|
54
|
+
try {
|
|
55
|
+
const response = await $fetch(`/api/checkout/quotation/guest/${slug}`, {
|
|
56
|
+
method: "GET",
|
|
57
|
+
query
|
|
58
|
+
});
|
|
59
|
+
if (response) {
|
|
60
|
+
publishableKey.value = response.data;
|
|
61
|
+
QuotationData.value = response;
|
|
62
|
+
responseData.value = response;
|
|
63
|
+
}
|
|
64
|
+
return response;
|
|
65
|
+
} catch (error) {
|
|
66
|
+
errorResponseData.value = error.data || error;
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const GuestCheckoutQuotation = async (slug, quotationData, query) => {
|
|
71
|
+
try {
|
|
72
|
+
responseData.value = [];
|
|
73
|
+
errorResponseData.value = [];
|
|
74
|
+
const FormData = quotationData.fields;
|
|
75
|
+
const response = await $fetch(`/api/checkout/quotation/guest/${slug}`, {
|
|
76
|
+
method: "POST",
|
|
77
|
+
body: FormData,
|
|
78
|
+
query
|
|
79
|
+
});
|
|
80
|
+
if (response) {
|
|
81
|
+
publishableKey.value = response.data;
|
|
82
|
+
responseData.value = response;
|
|
83
|
+
}
|
|
84
|
+
return response;
|
|
85
|
+
} catch (error) {
|
|
86
|
+
errorResponseData.value = error.data || error;
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const paymentMethods = async (formData) => {
|
|
91
|
+
try {
|
|
92
|
+
const response = await $fetch("/api/checkout/paymentmethod", {
|
|
93
|
+
method: "POST",
|
|
94
|
+
body: formData
|
|
95
|
+
});
|
|
96
|
+
if (response) {
|
|
97
|
+
publishableKey.value = response.data;
|
|
98
|
+
}
|
|
99
|
+
return response;
|
|
100
|
+
} catch (error) {
|
|
101
|
+
errorResponseData.value = error.data || error;
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const submitCheckout = async (slug, quotationData) => {
|
|
106
|
+
try {
|
|
107
|
+
responseData.value = [];
|
|
108
|
+
errorResponseData.value = [];
|
|
109
|
+
console.log("Data", slug, quotationData);
|
|
110
|
+
const response = await $fetch(`/api/checkout/quotation/submit/${slug}`, {
|
|
111
|
+
method: "POST",
|
|
112
|
+
body: quotationData
|
|
113
|
+
});
|
|
114
|
+
if (response.status == "Success") {
|
|
115
|
+
responseData.value = response.data;
|
|
116
|
+
}
|
|
117
|
+
return response;
|
|
118
|
+
} catch (error) {
|
|
119
|
+
errorResponseData.value = error.data || error;
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
inputData,
|
|
125
|
+
publishableKey,
|
|
126
|
+
responseData,
|
|
127
|
+
QuotationData,
|
|
128
|
+
checkoutSession,
|
|
129
|
+
preference,
|
|
130
|
+
errorResponseData,
|
|
131
|
+
resetState,
|
|
132
|
+
getQuotation,
|
|
133
|
+
getGuestQuotation,
|
|
134
|
+
GuestCheckoutQuotation,
|
|
135
|
+
paymentMethods,
|
|
136
|
+
submitCheckout
|
|
137
|
+
};
|
|
138
|
+
};
|
|
@@ -3,18 +3,18 @@ import { $fetch } from "ofetch";
|
|
|
3
3
|
export default defineEventHandler(async (event) => {
|
|
4
4
|
const body = await readBody(event);
|
|
5
5
|
try {
|
|
6
|
-
const
|
|
6
|
+
const response = await $fetch(`${process.env.FLOWRIX_API_BASE}checkout/paymentmethod`, {
|
|
7
7
|
method: "POST",
|
|
8
8
|
headers: {
|
|
9
|
-
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
10
|
-
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
11
|
-
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
9
|
+
"x-public-key": process.env.FLOWRIX_API_KEY || "",
|
|
10
|
+
"x-api-secret": process.env.FLOWRIX_API_SECRET || "",
|
|
11
|
+
"Origin": process.env.FLOWRIX_API_ORIGIN || ""
|
|
12
12
|
},
|
|
13
13
|
body
|
|
14
14
|
});
|
|
15
|
-
return
|
|
15
|
+
return response;
|
|
16
16
|
} catch (error) {
|
|
17
|
-
setResponseStatus(event, 500);
|
|
18
|
-
return { success: false, error: error.message };
|
|
17
|
+
setResponseStatus(event, error.statusCode || 500);
|
|
18
|
+
return { success: false, error: error.message, data: error.data };
|
|
19
19
|
}
|
|
20
20
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineEventHandler, setResponseStatus, getRouterParam, getCookie } from "h3";
|
|
2
|
+
import { $fetch } from "ofetch";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const slug = getRouterParam(event, "slug");
|
|
5
|
+
const accessTok = getCookie(event, "authToken");
|
|
6
|
+
try {
|
|
7
|
+
const response = await $fetch(`${process.env.FLOWRIX_API_BASE}mystore/customer/quotations/${slug}`, {
|
|
8
|
+
method: "GET",
|
|
9
|
+
headers: {
|
|
10
|
+
"x-public-key": process.env.FLOWRIX_API_KEY || "",
|
|
11
|
+
"x-api-secret": process.env.FLOWRIX_API_SECRET || "",
|
|
12
|
+
"Origin": process.env.FLOWRIX_API_ORIGIN || "",
|
|
13
|
+
"Authorization": `Bearer ${accessTok || ""}`
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return response;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
setResponseStatus(event, error.statusCode || 500);
|
|
19
|
+
return { success: false, error: error.message, data: error.data };
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineEventHandler, setResponseStatus, getRouterParam, readBody, getMethod, getQuery } from "h3";
|
|
2
|
+
import { $fetch } from "ofetch";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const slug = getRouterParam(event, "slug");
|
|
5
|
+
const method = getMethod(event);
|
|
6
|
+
const query = getQuery(event);
|
|
7
|
+
try {
|
|
8
|
+
if (method === "GET") {
|
|
9
|
+
const response = await $fetch(`${process.env.FLOWRIX_API_BASE}quotations/${slug}`, {
|
|
10
|
+
method: "GET",
|
|
11
|
+
headers: {
|
|
12
|
+
"x-public-key": process.env.FLOWRIX_API_KEY || "",
|
|
13
|
+
"x-api-secret": process.env.FLOWRIX_API_SECRET || "",
|
|
14
|
+
"Origin": process.env.FLOWRIX_API_ORIGIN || ""
|
|
15
|
+
},
|
|
16
|
+
query
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
} else if (method === "POST") {
|
|
20
|
+
const body = await readBody(event);
|
|
21
|
+
const response = await $fetch(`${process.env.FLOWRIX_API_BASE}quotations/${slug}`, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: {
|
|
24
|
+
"x-public-key": process.env.FLOWRIX_API_KEY || "",
|
|
25
|
+
"x-api-secret": process.env.FLOWRIX_API_SECRET || "",
|
|
26
|
+
"Origin": process.env.FLOWRIX_API_ORIGIN || ""
|
|
27
|
+
},
|
|
28
|
+
body,
|
|
29
|
+
query
|
|
30
|
+
});
|
|
31
|
+
return response;
|
|
32
|
+
}
|
|
33
|
+
} catch (error) {
|
|
34
|
+
setResponseStatus(event, error.statusCode || 500);
|
|
35
|
+
return { success: false, error: error.message, data: error.data };
|
|
36
|
+
}
|
|
37
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineEventHandler, setResponseStatus, readBody, getMethod } from "h3";
|
|
2
|
+
import { $fetch } from "ofetch";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const method = getMethod(event);
|
|
5
|
+
const body = method === "POST" ? await readBody(event) : void 0;
|
|
6
|
+
try {
|
|
7
|
+
const response = await $fetch(`${process.env.FLOWRIX_API_BASE}checkout/quotation/customer`, {
|
|
8
|
+
method,
|
|
9
|
+
headers: {
|
|
10
|
+
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
11
|
+
"x-api-secret": process.env.FLOWRIX_API_SECRET,
|
|
12
|
+
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
13
|
+
},
|
|
14
|
+
body
|
|
15
|
+
});
|
|
16
|
+
return response;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
setResponseStatus(event, 500);
|
|
19
|
+
return { success: false, error: error.message };
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineEventHandler, setResponseStatus, readBody, getCookie, getRouterParam } from "h3";
|
|
2
|
+
import { $fetch } from "ofetch";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const slug = getRouterParam(event, "slug");
|
|
5
|
+
const body = await readBody(event);
|
|
6
|
+
const accessTok = getCookie(event, "authToken");
|
|
7
|
+
try {
|
|
8
|
+
const response = await $fetch(`${process.env.FLOWRIX_API_BASE}mystore/customer/checkout/quotation/${slug}`, {
|
|
9
|
+
method: "POST",
|
|
10
|
+
headers: {
|
|
11
|
+
"x-public-key": process.env.FLOWRIX_API_KEY || "",
|
|
12
|
+
"x-api-secret": process.env.FLOWRIX_API_SECRET || "",
|
|
13
|
+
"Origin": process.env.FLOWRIX_API_ORIGIN || "",
|
|
14
|
+
"Authorization": `Bearer ${accessTok || ""}`
|
|
15
|
+
},
|
|
16
|
+
body
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
setResponseStatus(event, error.statusCode || 500);
|
|
21
|
+
return { success: false, error: error.message, data: error.data };
|
|
22
|
+
}
|
|
23
|
+
});
|