flowrix 1.0.1-beta.8 → 1.0.1-beta.80
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.d.mts +1 -6
- package/dist/module.json +1 -1
- package/dist/module.mjs +94 -29
- package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
- package/dist/runtime/composables/Brand/brand.js +2 -0
- package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
- package/dist/runtime/composables/Cart/useCart.js +10 -0
- package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
- package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +2 -2
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +2 -2
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +84 -73
- package/dist/runtime/composables/Checkout/useCheckout.js +36 -28
- package/dist/runtime/composables/Checkout/{useBillingAddress.d.ts → useCheckoutBillingAddress.d.ts} +6 -6
- package/dist/runtime/composables/Checkout/{useBillingAddress.js → useCheckoutBillingAddress.js} +6 -1
- package/dist/runtime/composables/Checkout/{useShippingAddress.d.ts → useCheckoutShippingAddress.d.ts} +1 -1
- package/dist/runtime/composables/Checkout/{useShippingAddress.js → useCheckoutShippingAddress.js} +7 -2
- package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
- package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
- package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
- package/dist/runtime/composables/Checkout/useDeliveryMethod.js +8 -7
- package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
- package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
- package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
- package/dist/runtime/composables/Customer/useLogin.js +34 -0
- package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
- package/dist/runtime/composables/Customer/useOrders.js +56 -0
- package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
- package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
- package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
- package/dist/runtime/composables/Customer/useProfile.js +106 -0
- package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
- package/dist/runtime/composables/Customer/useQuotations.js +40 -0
- package/dist/runtime/composables/Customer/useRegister.d.ts +118 -11
- package/dist/runtime/composables/Customer/useRegister.js +236 -34
- package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
- package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
- package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
- package/dist/runtime/composables/Customer/useUpdatePassword.js +94 -0
- package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
- package/dist/runtime/composables/Customer/useUserCards.js +65 -0
- package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +5 -18
- package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +19 -28
- package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
- package/dist/runtime/composables/Extras/useCountry.js +5 -4
- package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
- package/dist/runtime/composables/Header/useHeader.js +3 -2
- package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
- package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
- package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
- package/dist/runtime/composables/Product/useQuickView.js +27 -0
- package/dist/runtime/composables/Product/useService.d.ts +1 -1
- package/dist/runtime/composables/Product/useService.js +0 -3
- package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
- package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
- package/dist/runtime/composables/index.d.ts +15 -12
- package/dist/runtime/composables/index.js +15 -12
- package/dist/runtime/composables/useAddresses.js +6 -6
- package/dist/runtime/composables/useCards.js +2 -2
- package/dist/runtime/composables/useLocation.d.ts +2 -12
- package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
- package/dist/runtime/composables/useQuotationCheckout.js +138 -0
- package/dist/runtime/middleware/flowrix.d.ts +5 -4
- package/dist/runtime/middleware/flowrix.js +41 -21
- package/dist/runtime/plugin.d.ts +1 -1
- package/dist/runtime/server/api/albums.js +1 -1
- package/dist/runtime/server/api/auth/forgot.js +1 -1
- package/dist/runtime/server/api/auth/login.js +5 -6
- package/dist/runtime/server/api/auth/logout.js +1 -1
- package/dist/runtime/server/api/auth/register.js +1 -1
- package/dist/runtime/server/api/auth/session.get.js +1 -1
- package/dist/runtime/server/api/auth/user/reset-password.js +1 -1
- package/dist/runtime/server/api/auth/user/session.js +1 -1
- package/dist/runtime/server/api/auth/user/verify-token.js +1 -1
- package/dist/runtime/server/api/banners.js +2 -2
- package/dist/runtime/server/api/brand/{[slug].js → [...slug].js} +17 -17
- package/dist/runtime/server/api/brand/index.d.ts +2 -0
- package/dist/runtime/server/api/brand/index.js +23 -0
- package/dist/runtime/server/api/cache/[...slug].delete.d.ts +2 -0
- package/dist/runtime/server/api/cache/[...slug].delete.js +40 -0
- package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
- package/dist/runtime/server/api/cache/clean.get.js +16 -0
- package/dist/runtime/server/api/cart/[slug]/add.js +1 -1
- package/dist/runtime/server/api/cart/[slug]/update.js +1 -1
- package/dist/runtime/server/api/cart/related.d.ts +2 -0
- package/dist/runtime/server/api/cart/related.js +21 -0
- package/dist/runtime/server/api/cart/remove.js +1 -1
- package/dist/runtime/server/api/cart/service/[slug]/add.js +1 -1
- package/dist/runtime/server/api/catalog/categories.js +5 -4
- package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
- package/dist/runtime/server/api/catalog/categoriesall.js +44 -0
- package/dist/runtime/server/api/catalog/featured.js +5 -4
- package/dist/runtime/server/api/catalog/samples.js +5 -4
- package/dist/runtime/server/api/catalog/search.js +5 -4
- package/dist/runtime/server/api/category/[...slug].js +18 -14
- package/dist/runtime/server/api/checkout/applyCoupon.js +1 -1
- package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
- package/dist/runtime/server/api/checkout/configs.js +10 -11
- package/dist/runtime/server/api/checkout/countries.js +1 -1
- 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/dist/runtime/server/api/{blog/[slug].js → cmspost/[...slug].js} +7 -9
- package/dist/runtime/server/api/{blog/blog.js → cmspost/all.js} +2 -2
- package/dist/runtime/server/api/company/profile.d.ts +1 -1
- package/dist/runtime/server/api/company/profile.js +9 -9
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +1 -1
- package/dist/runtime/server/api/contact-center/webforms/create.js +1 -1
- package/dist/runtime/server/api/countries.d.ts +2 -0
- package/dist/runtime/server/api/countries.js +35 -0
- package/dist/runtime/server/api/customer/address/add.js +1 -1
- package/dist/runtime/server/api/customer/address/delete.js +2 -2
- package/dist/runtime/server/api/customer/address/setshipping.js +1 -1
- package/dist/runtime/server/api/customer/address/update.js +1 -1
- package/dist/runtime/server/api/customer/cards/delete.js +2 -2
- package/dist/runtime/server/api/customer/cards/get.js +2 -2
- package/dist/runtime/server/api/customer/change-password.js +2 -2
- package/dist/runtime/server/api/customer/checkout.js +1 -1
- package/dist/runtime/server/api/customer/orders.js +2 -2
- package/dist/runtime/server/api/customer/profile/update.js +1 -1
- package/dist/runtime/server/api/customer/quotations.js +2 -2
- package/dist/runtime/server/api/customer/search.js +1 -1
- package/dist/runtime/server/api/customer/tax-invoice.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/add.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/get.js +2 -2
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -1
- package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -2
- package/dist/runtime/server/api/featured.d.ts +2 -0
- package/dist/runtime/server/api/featured.js +16 -0
- package/dist/runtime/server/api/location.js +1 -1
- package/dist/runtime/server/api/nav/[id]/links.js +1 -1
- package/dist/runtime/server/api/page/{[slug].js → [...slug].js} +6 -8
- package/dist/runtime/server/api/product/[...slug].js +8 -5
- package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
- package/dist/runtime/server/api/quickview/[slug].js +16 -0
- package/dist/runtime/server/api/samples.d.ts +3 -0
- package/dist/runtime/server/api/samples.js +20 -0
- package/dist/runtime/server/api/search.d.ts +3 -0
- package/dist/runtime/server/api/search.js +15 -0
- package/dist/runtime/server/api/service/[slug].js +5 -4
- package/dist/runtime/server/api/service/availability.js +1 -1
- package/dist/runtime/server/api/service/getall.d.ts +3 -0
- package/dist/runtime/server/api/service/getall.js +52 -0
- package/dist/runtime/server/api/shop.d.ts +3 -0
- package/dist/runtime/server/api/shop.js +15 -0
- package/dist/runtime/server/api/subscribe.js +1 -1
- package/dist/runtime/server/api/v2/[...slug].js +3 -1
- package/dist/runtime/server/api/webform.d.ts +3 -0
- package/dist/runtime/server/api/webform.js +16 -0
- package/dist/runtime/stores/Cart.d.ts +12 -0
- package/dist/runtime/stores/Cart.js +50 -16
- package/dist/runtime/stores/Checkout.d.ts +9 -15
- package/dist/runtime/stores/Checkout.js +19 -5
- package/dist/runtime/stores/Search.d.ts +1 -1
- package/dist/runtime/stores/Services.js +2 -2
- package/dist/runtime/stores/auth.d.ts +8 -11
- package/dist/runtime/stores/auth.js +390 -8
- package/dist/runtime/stores/countries.d.ts +1 -3
- package/dist/runtime/stores/countries.js +4 -8
- package/dist/runtime/stores/product/slug.d.ts +1 -17
- package/dist/runtime/stores/wishlists.d.ts +105 -5
- package/dist/runtime/stores/wishlists.js +200 -9
- package/dist/runtime/utils/api.js +9 -13
- package/dist/runtime/utils/htmlCache.d.ts +5 -0
- package/dist/runtime/utils/htmlCache.js +60 -0
- package/dist/types.d.mts +6 -2
- package/package.json +32 -20
- package/dist/runtime/composables/useAuth.d.ts +0 -45
- package/dist/runtime/composables/useAuth.js +0 -180
- package/dist/runtime/composables/useCountries.d.ts +0 -12
- package/dist/runtime/composables/useCountries.js +0 -50
- package/dist/runtime/composables/useOrders.d.ts +0 -21
- package/dist/runtime/composables/useOrders.js +0 -82
- package/dist/runtime/composables/useQuotations.d.ts +0 -14
- package/dist/runtime/composables/useQuotations.js +0 -50
- /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
- /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
- /package/dist/runtime/server/api/{blog/blog.d.ts → cmspost/all.d.ts} +0 -0
- /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import { useCountriesStore } from "../stores/countries.js";
|
|
3
|
-
import { useApi } from "../utils/api.js";
|
|
4
|
-
function formatErrorMessage(message) {
|
|
5
|
-
if (!message) return "An error occurred";
|
|
6
|
-
if (typeof message === "string") {
|
|
7
|
-
return message;
|
|
8
|
-
}
|
|
9
|
-
const errorMessages = [];
|
|
10
|
-
for (const [field, errors] of Object.entries(message)) {
|
|
11
|
-
if (Array.isArray(errors)) {
|
|
12
|
-
errorMessages.push(...errors);
|
|
13
|
-
} else {
|
|
14
|
-
errorMessages.push(String(errors));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return errorMessages.join(", ");
|
|
18
|
-
}
|
|
19
|
-
export function useCountries() {
|
|
20
|
-
const store = useCountriesStore();
|
|
21
|
-
const { get } = useApi();
|
|
22
|
-
async function fetchCountries() {
|
|
23
|
-
store.setLoading(true);
|
|
24
|
-
store.setError(null);
|
|
25
|
-
try {
|
|
26
|
-
const response = await get("/countries");
|
|
27
|
-
if (response.status === "Success" && response.data) {
|
|
28
|
-
store.setCountries(response.data);
|
|
29
|
-
return response;
|
|
30
|
-
} else {
|
|
31
|
-
const errorMessage = formatErrorMessage(response.message);
|
|
32
|
-
store.setError(errorMessage);
|
|
33
|
-
throw new Error(errorMessage);
|
|
34
|
-
}
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error("Fetch countries error:", error);
|
|
37
|
-
const errorMessage = error.data ? formatErrorMessage(error.data.message) : error.message || "Failed to fetch countries";
|
|
38
|
-
store.setError(errorMessage);
|
|
39
|
-
throw new Error(errorMessage);
|
|
40
|
-
} finally {
|
|
41
|
-
store.setLoading(false);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
fetchCountries,
|
|
46
|
-
countries: computed(() => store.countries),
|
|
47
|
-
loading: computed(() => store.loading),
|
|
48
|
-
error: computed(() => store.error)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type Order } from '../stores/orders.js';
|
|
2
|
-
export interface ApiResponse<T> {
|
|
3
|
-
status: string;
|
|
4
|
-
message: string | Record<string, string[]> | null;
|
|
5
|
-
data: T | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function useOrders(): {
|
|
8
|
-
fetchOrders: () => Promise<ApiResponse<Order[]>>;
|
|
9
|
-
downloadInvoice: (orderNo: string) => Promise<void>;
|
|
10
|
-
orders: import("vue").ComputedRef<{
|
|
11
|
-
id: number;
|
|
12
|
-
order_no: string;
|
|
13
|
-
order_status: string;
|
|
14
|
-
payment_method: string;
|
|
15
|
-
grandtotal: number;
|
|
16
|
-
}[]>;
|
|
17
|
-
loading: import("vue").ComputedRef<boolean>;
|
|
18
|
-
error: import("vue").ComputedRef<string | null>;
|
|
19
|
-
loadingInvoice: import("vue").ComputedRef<string | null>;
|
|
20
|
-
downloadError: import("vue").ComputedRef<string | null>;
|
|
21
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ref, computed } from "vue";
|
|
2
|
-
import { useOrdersStore } from "../stores/orders.js";
|
|
3
|
-
import { useApi } from "../utils/api.js";
|
|
4
|
-
function formatErrorMessage(message) {
|
|
5
|
-
if (!message) return "An error occurred";
|
|
6
|
-
if (typeof message === "string") {
|
|
7
|
-
return message;
|
|
8
|
-
}
|
|
9
|
-
const errorMessages = [];
|
|
10
|
-
for (const [field, errors] of Object.entries(message)) {
|
|
11
|
-
if (Array.isArray(errors)) {
|
|
12
|
-
errorMessages.push(...errors);
|
|
13
|
-
} else {
|
|
14
|
-
errorMessages.push(String(errors));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return errorMessages.join(", ");
|
|
18
|
-
}
|
|
19
|
-
export function useOrders() {
|
|
20
|
-
const store = useOrdersStore();
|
|
21
|
-
const { get } = useApi();
|
|
22
|
-
const loadingInvoice = ref(null);
|
|
23
|
-
const error = ref(null);
|
|
24
|
-
async function fetchOrders() {
|
|
25
|
-
store.setLoading(true);
|
|
26
|
-
store.setError(null);
|
|
27
|
-
try {
|
|
28
|
-
const response = await get("/customer/orders");
|
|
29
|
-
if (response.status === "Success" && response.data) {
|
|
30
|
-
store.setOrders(response.data);
|
|
31
|
-
return response;
|
|
32
|
-
} else {
|
|
33
|
-
const errorMessage = formatErrorMessage(response.message);
|
|
34
|
-
store.setError(errorMessage);
|
|
35
|
-
throw new Error(errorMessage);
|
|
36
|
-
}
|
|
37
|
-
} catch (error2) {
|
|
38
|
-
console.error("Fetch orders error:", error2);
|
|
39
|
-
const errorMessage = error2.data ? formatErrorMessage(error2.data.message) : error2.message || "Failed to fetch orders";
|
|
40
|
-
store.setError(errorMessage);
|
|
41
|
-
throw new Error(errorMessage);
|
|
42
|
-
} finally {
|
|
43
|
-
store.setLoading(false);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async function downloadInvoice(orderNo) {
|
|
47
|
-
loadingInvoice.value = orderNo;
|
|
48
|
-
error.value = null;
|
|
49
|
-
try {
|
|
50
|
-
const response = await get(`customer/orders/${orderNo}/tax-invoice`, {
|
|
51
|
-
params: { orderNo },
|
|
52
|
-
responseType: "blob"
|
|
53
|
-
});
|
|
54
|
-
const blob = new Blob([response], { type: "application/pdf" });
|
|
55
|
-
const url = window.URL.createObjectURL(blob);
|
|
56
|
-
const link = document.createElement("a");
|
|
57
|
-
link.href = url;
|
|
58
|
-
link.setAttribute("download", `tax-invoice-${orderNo}.pdf`);
|
|
59
|
-
document.body.appendChild(link);
|
|
60
|
-
link.click();
|
|
61
|
-
document.body.removeChild(link);
|
|
62
|
-
window.URL.revokeObjectURL(url);
|
|
63
|
-
return;
|
|
64
|
-
} catch (err) {
|
|
65
|
-
console.error("Download invoice error:", err);
|
|
66
|
-
const errorMessage = err.data ? formatErrorMessage(err.data.message) : err.message || "Failed to download invoice";
|
|
67
|
-
error.value = errorMessage;
|
|
68
|
-
throw new Error(errorMessage);
|
|
69
|
-
} finally {
|
|
70
|
-
loadingInvoice.value = null;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
fetchOrders,
|
|
75
|
-
downloadInvoice,
|
|
76
|
-
orders: computed(() => store.orders),
|
|
77
|
-
loading: computed(() => store.loading),
|
|
78
|
-
error: computed(() => store.error),
|
|
79
|
-
loadingInvoice: computed(() => loadingInvoice.value),
|
|
80
|
-
downloadError: computed(() => error.value)
|
|
81
|
-
};
|
|
82
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Quotation } from '../stores/quotations.js';
|
|
2
|
-
export interface ApiResponse<T> {
|
|
3
|
-
status: string;
|
|
4
|
-
message: string | Record<string, string[]> | null;
|
|
5
|
-
data: T | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function useQuotations(): {
|
|
8
|
-
fetchQuotations: () => Promise<ApiResponse<Quotation[]>>;
|
|
9
|
-
quotations: import("vue").ComputedRef<{
|
|
10
|
-
id: number;
|
|
11
|
-
}[]>;
|
|
12
|
-
loading: import("vue").ComputedRef<boolean>;
|
|
13
|
-
error: import("vue").ComputedRef<string | null>;
|
|
14
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
import { useQuotationsStore } from "../stores/quotations.js";
|
|
3
|
-
import { useApi } from "../utils/api.js";
|
|
4
|
-
function formatErrorMessage(message) {
|
|
5
|
-
if (!message) return "An error occurred";
|
|
6
|
-
if (typeof message === "string") {
|
|
7
|
-
return message;
|
|
8
|
-
}
|
|
9
|
-
const errorMessages = [];
|
|
10
|
-
for (const [field, errors] of Object.entries(message)) {
|
|
11
|
-
if (Array.isArray(errors)) {
|
|
12
|
-
errorMessages.push(...errors);
|
|
13
|
-
} else {
|
|
14
|
-
errorMessages.push(String(errors));
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return errorMessages.join(", ");
|
|
18
|
-
}
|
|
19
|
-
export function useQuotations() {
|
|
20
|
-
const store = useQuotationsStore();
|
|
21
|
-
const { get } = useApi();
|
|
22
|
-
async function fetchQuotations() {
|
|
23
|
-
store.setLoading(true);
|
|
24
|
-
store.setError(null);
|
|
25
|
-
try {
|
|
26
|
-
const response = await get("/customer/quotations");
|
|
27
|
-
if (response.status === "Success" && response.data) {
|
|
28
|
-
store.setQuotations(response.data);
|
|
29
|
-
return response;
|
|
30
|
-
} else {
|
|
31
|
-
const errorMessage = formatErrorMessage(response.message);
|
|
32
|
-
store.setError(errorMessage);
|
|
33
|
-
throw new Error(errorMessage);
|
|
34
|
-
}
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error("Fetch quotations error:", error);
|
|
37
|
-
const errorMessage = error.data ? formatErrorMessage(error.data.message) : error.message || "Failed to fetch quotations";
|
|
38
|
-
store.setError(errorMessage);
|
|
39
|
-
throw new Error(errorMessage);
|
|
40
|
-
} finally {
|
|
41
|
-
store.setLoading(false);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
fetchQuotations,
|
|
46
|
-
quotations: computed(() => store.quotations),
|
|
47
|
-
loading: computed(() => store.loading),
|
|
48
|
-
error: computed(() => store.error)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|