@ozdao/prometheus-framework 0.1.68 → 0.1.69
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-59a591ab.js +1 -0
- package/dist/BackofficeGallery-be6f69a9.mjs +307 -0
- package/dist/BackofficeReports-06166952.js +1 -0
- package/dist/BackofficeReports-50fd799c.mjs +44 -0
- package/dist/BlockTags-00325fa0.mjs +853 -0
- package/dist/BlockTags-58f95c8a.js +1 -0
- package/dist/ButtonToggleMembership-84d0e018.mjs +90 -0
- package/dist/ButtonToggleMembership-b905812f.js +1 -0
- package/dist/CardBlogpost-1b81b54e.mjs +246 -0
- package/dist/CardBlogpost-7107e04a.js +1 -0
- package/dist/CardOrganization-49ab5190.mjs +234 -0
- package/dist/CardOrganization-e6ac27f1.js +1 -0
- package/dist/CardProduct-4c0cb9a1.js +1 -0
- package/dist/CardProduct-ea0e1f84.mjs +192 -0
- package/dist/Chips-817cf959.js +1 -0
- package/dist/Chips-8c836ba6.mjs +213 -0
- package/dist/Community-8c4e011b.js +1 -0
- package/dist/Community-bd6f0cbb.mjs +131 -0
- package/dist/Dashboard-73b50724.js +1 -0
- package/dist/Dashboard-bc81b5f6.mjs +151 -0
- package/dist/Dropdown-60e3dc6c.js +1 -0
- package/dist/Dropdown-d1c81d45.mjs +169 -0
- package/dist/EditOrder-2b746caf.mjs +221 -0
- package/dist/EditOrder-e632f0cc.js +1 -0
- package/dist/Events-999cc8ed.js +1 -0
- package/dist/Events-ad8bbf27.mjs +134 -0
- package/dist/Feed-35e13c22.mjs +156 -0
- package/dist/Feed-53d96b18.mjs +361 -0
- package/dist/Feed-694a2fad.js +1 -0
- package/dist/Feed-ac4bb6ea.js +1 -0
- package/dist/Feed-d1d01771.js +1 -0
- package/dist/Feed-f7c04014.mjs +124 -0
- package/dist/Image-61cfd52d.js +9 -0
- package/dist/Image-e8be4acc.mjs +480 -0
- package/dist/LeftoverAdd-a268a95c.js +1 -0
- package/dist/LeftoverAdd-e4d93760.mjs +229 -0
- package/dist/Leftovers-6976802d.mjs +135 -0
- package/dist/Leftovers-d8f1d152.js +1 -0
- package/dist/Members-aeb2bca1.mjs +109 -0
- package/dist/Members-b9664e83.js +1 -0
- package/dist/Menu-93d34d9f.js +1 -0
- package/dist/Menu-eaf6b44c.mjs +13 -0
- package/dist/MenuItem-4a5881bd.mjs +85 -0
- package/dist/MenuItem-f35cad93.js +1 -0
- package/dist/Orders-8bc8963c.js +1 -0
- package/dist/Orders-eb262d8c.mjs +75 -0
- package/dist/Organizations-9926aa51.mjs +72 -0
- package/dist/Organizations-c653d814.js +1 -0
- package/dist/Payments-98328000.js +1 -0
- package/dist/Payments-a9066cdf.mjs +11 -0
- package/dist/Popup-0d8e1392.mjs +96 -0
- package/dist/Popup-eb11fa82.js +1 -0
- package/dist/Product-15043af7.mjs +651 -0
- package/dist/Product-82c022a4.js +7 -0
- package/dist/ProductEdit-05da9866.mjs +258 -0
- package/dist/ProductEdit-2f075296.js +1 -0
- package/dist/ProductsBackoffice-8462f626.js +1 -0
- package/dist/ProductsBackoffice-8d0f0ee8.mjs +85 -0
- package/dist/ProfileBlogposts-43855cb9.js +1 -0
- package/dist/ProfileBlogposts-f32170a3.mjs +78 -0
- package/dist/ProfileEvents-54be2d43.mjs +69 -0
- package/dist/ProfileEvents-ab69e27e.js +1 -0
- package/dist/ProfileOrganizations-0787cf34.mjs +72 -0
- package/dist/ProfileOrganizations-eb62dde4.js +1 -0
- package/dist/Publics-8e726d20.mjs +45 -0
- package/dist/Publics-ae589bf1.js +1 -0
- package/dist/Select-95f4701a.js +1 -0
- package/dist/Select-dab17282.mjs +80 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js +1 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs +1 -0
- package/dist/Socials-43293869.js +1 -0
- package/dist/Socials-8193477c.mjs +189 -0
- package/dist/UploadImage-0e8e4278.mjs +83 -0
- package/dist/UploadImage-8c71bda6.js +1 -0
- package/dist/UploadImageMultiple-c34a6c6f.mjs +58 -0
- package/dist/UploadImageMultiple-d1316df5.js +1 -0
- package/dist/Wallet-727195d9.mjs +21700 -0
- package/dist/Wallet-f4dda407.js +10 -0
- package/dist/auth-04684a60.js +7 -0
- package/dist/auth-7e39361f.mjs +633 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +5 -5
- package/dist/auth.server.js +1 -1
- package/dist/auth.server.mjs +1 -1
- package/dist/auth.validation-d614130d.js +1 -0
- package/dist/auth.validation-f4bf1deb.mjs +24 -0
- package/dist/axios-33aeb810.mjs +1435 -0
- package/dist/axios-ceccf20e.js +5 -0
- package/dist/backoffice.client.cjs +1 -1
- package/dist/backoffice.client.js +20 -20
- package/dist/categories-7e17a7eb.js +1 -0
- package/dist/categories-b7f9e8c0.mjs +122 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +209 -202
- package/dist/components/Upload/Upload.vue.d.ts.map +1 -1
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +24 -27
- package/dist/landing.client.cjs +1 -1
- package/dist/landing.client.js +64 -40
- package/dist/leftovers-86e7d438.mjs +67 -0
- package/dist/leftovers-c9f70579.js +1 -0
- package/dist/legal.client.cjs +1 -1
- package/dist/legal.client.js +6 -7
- package/dist/main.css +1 -1
- package/dist/memberships-559590ad.mjs +68 -0
- package/dist/memberships-58af22e0.js +1 -0
- package/dist/modules/constructor/components/elements/H2.vue.d.ts +1 -1
- package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +1 -1
- package/dist/modules/products/components/sections/EditProductInfo.vue.d.ts +1 -5
- package/dist/orders-1325c51b.js +1 -0
- package/dist/orders-c7cbe706.mjs +85 -0
- package/dist/organizations-71777b32.js +1 -0
- package/dist/organizations-93f7b610.mjs +122 -0
- package/dist/organizations.client-6ca27fb3.js +3 -0
- package/dist/organizations.client-bd63a7b2.mjs +2997 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +56 -61
- package/dist/products-61d83d74.js +1 -0
- package/dist/products-7f1e5a75.mjs +108 -0
- package/dist/prometheus-framework.cjs.js +21 -21
- package/dist/prometheus-framework.es.js +682 -690
- package/dist/reports-a67b4fb4.js +1 -0
- package/dist/reports-c579b02a.mjs +91 -0
- package/dist/reports.client.cjs +1 -1
- package/dist/reports.client.js +2 -2
- package/dist/states.validation-3b4604bc.mjs +13 -0
- package/dist/states.validation-9b43a097.js +1 -0
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +279 -208
- package/package.json +30 -35
- package/src/components/Button/Button.vue +1 -1
- package/src/components/Sidebar/Sidebar.vue +10 -8
- package/src/components/Upload/Upload.vue +8 -28
- package/src/modules/auth/controllers/auth.controller.js +1 -1
- package/src/modules/auth/store/auth.js +21 -24
- package/src/modules/backoffice/components/admin/ProductEdit.vue +2 -0
- package/src/modules/constructor/components/sections/Constructor.vue +7 -54
- package/src/modules/gallery/components/pages/Gallery.vue +7 -1
- package/src/modules/gallery/components/sections/GalleryWithCategories.vue +24 -8
- package/src/modules/gallery/gallery.client.js +5 -1
- package/src/modules/marketplace/components/layouts/Marketplace.vue +1 -0
- package/src/modules/organizations/components/pages/Organization.vue +2 -2
- package/src/modules/payments/components/pages/Payments.vue +4 -3
- package/src/modules/products/components/blocks/CardLeftover.vue +0 -1
- package/src/modules/products/components/blocks/CardProduct.vue +15 -1
- package/src/modules/products/components/sections/EditProductInfo.vue +16 -14
- package/src/modules/products/components/sections/FilterProducts.vue +0 -2
- package/src/modules/products/components/sections/SectionProduct.vue +1 -0
- package/src/modules/products/components/sections/SortProducts.vue +2 -0
- package/src/modules/products/store/categories.js +9 -9
- package/src/modules/products/store/leftovers.js +6 -9
- package/src/modules/products/store/products.js +2 -0
- package/src/modules/users/components/pages/Profile.vue +3 -5
- package/src/modules/wallet/components/pages/Wallet.vue +1 -1
- package/src/styles/components/button.scss +253 -0
- package/src/styles/theme.scss +1 -0
- package/src/modules/constructor/components/elements/Audio.vue +0 -82
- package/src/modules/constructor/components/elements/Embed.vue +0 -85
- package/src/modules/globals/mixins/mixins.js +0 -52
- package/src/modules/globals/router/routerGuards.js +0 -28
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./organizations.client-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./organizations.client-6ca27fb3.js"),r=require("./Organizations-c653d814.js"),i=require("./CardOrganization-e6ac27f1.js"),t=require("./Socials-43293869.js"),n=require("./Publics-ae589bf1.js"),a=require("./ButtonToggleMembership-b905812f.js"),u=require("./memberships-58af22e0.js"),s=require("./organizations-71777b32.js");require("vue");require("vue-router");require("vue-i18n");require("./globals-928eb13c.js");require("./Breadcrumbs.vue_vue_type_style_index_0_lang-0ea8fbf8.js");require("./Tab-2c1e4224.js");require("./Tab.vue_vue_type_style_index_0_lang-0ea8fbf8.js");require("./MenuItem-f35cad93.js");require("./_plugin-vue_export-helper-f246444f.js");require("./Feed-694a2fad.js");require("./Loader.vue_vue_type_style_index_0_lang-0ea8fbf8.js");require("./EmptyState-d65bab5b.js");require("./Chips-817cf959.js");require("./Dropdown-60e3dc6c.js");require("./Popup-eb11fa82.js");require("./Popup.vue_vue_type_style_index_0_lang-0ea8fbf8.js");require("./Button-7643c9aa.js");require("./Button.vue_vue_type_style_index_0_lang-0ea8fbf8.js");require("./Select-95f4701a.js");require("./Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js");require("./reports-a67b4fb4.js");require("./axios-ceccf20e.js");require("./click-outside-0b0727d1.js");require("./auth-04684a60.js");require("./IconEdit-c0469b45.js");require("./SkeletonEvent-eb284de8.js");require("./Feed-ac4bb6ea.js");require("./Loader-21f016da.js");require("./CardBlogpost-7107e04a.js");require("./Checkbox-76f09248.js");require("./categories-7e17a7eb.js");require("./Feed-98b47c6f.js");require("./CardProduct-4c0cb9a1.js");require("./products-61d83d74.js");require("./Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-0ea8fbf8.js");require("./inputs.validation-d7cef32b.js");require("./BlockTags-58f95c8a.js");require("./Field-e2a43424.js");require("./SelectMulti-c25765cf.js");require("./UploadImage-8c71bda6.js");require("./auth.validation-d614130d.js");require("./Feed-d1d01771.js");exports.CardDepartment=e.CardDepartment;exports.Contacts=e._sfc_main$9;exports.Department=e._sfc_main$3;exports.DepartmentEdit=e.DepartmentEdit;exports.DepartmentMemberModify=e.DepartmentMemberModify;exports.DepartmentSub=e.DepartmentSub;exports.DetailsTab=e._sfc_main$11;exports.Documents=e.Documents;exports.EditArray=e._sfc_main$5;exports.EmptyState=e._sfc_main$8;exports.FeedDepartments=e._sfc_main$10;exports.MembersAdd=e._sfc_main;exports.MembersList=e._sfc_main$1;exports.Organization=e._sfc_main$2;exports.OrganizationEdit=e._sfc_main$4;exports.OrganizationsSection=e._sfc_main$12;exports.Rating=e._sfc_main$7;exports.Unit=e._sfc_main$6;exports.User=e.User;exports.departmentsStore=e.departments;exports.invitesStore=e.invites;exports.organizationsRouter=e.organizations;exports.Organizations=r.default;exports.CardOrganization=i._sfc_main;exports.Socials=t._sfc_main;exports.Publics=n._sfc_main;exports.ButtonToggleMembership=a._sfc_main;exports.membershipsStore=u.memberships;exports.organizationStore=s.organization;
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { C as
|
2
|
-
import { default as
|
3
|
-
import { _ as
|
4
|
-
import { _ as
|
5
|
-
import { _ as
|
6
|
-
import { _ as
|
7
|
-
import { b as
|
8
|
-
import { o as
|
1
|
+
import { C as J, l as K, d as N, D as Q, i as V, h as W, n as X, p as Y, f as Z, k as $, m as tt, _ as rt, b as ot, c as it, e as mt, o as pt, j as at, g as et, U as st, r as nt, q as dt, t as ft } from "./organizations.client-bd63a7b2.mjs";
|
2
|
+
import { default as bt } from "./Organizations-9926aa51.mjs";
|
3
|
+
import { _ as xt } from "./CardOrganization-49ab5190.mjs";
|
4
|
+
import { _ as zt } from "./Socials-8193477c.mjs";
|
5
|
+
import { _ as lt } from "./Publics-8e726d20.mjs";
|
6
|
+
import { _ as Mt } from "./ButtonToggleMembership-84d0e018.mjs";
|
7
|
+
import { b as _t } from "./memberships-559590ad.mjs";
|
8
|
+
import { o as Et } from "./organizations-93f7b610.mjs";
|
9
9
|
import "vue";
|
10
10
|
import "vue-router";
|
11
11
|
import "vue-i18n";
|
@@ -13,74 +13,69 @@ import "./globals-96ba60e4.mjs";
|
|
13
13
|
import "./Breadcrumbs.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
|
14
14
|
import "./Tab-054b61f7.mjs";
|
15
15
|
import "./Tab.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
|
16
|
-
import "./MenuItem-
|
17
|
-
import "./IconChevronRight-fae9d012.mjs";
|
16
|
+
import "./MenuItem-4a5881bd.mjs";
|
18
17
|
import "./_plugin-vue_export-helper-dad06003.mjs";
|
19
|
-
import "./Feed-
|
18
|
+
import "./Feed-53d96b18.mjs";
|
20
19
|
import "./Loader.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
|
21
20
|
import "./EmptyState-e404b05d.mjs";
|
22
|
-
import "./Chips-
|
23
|
-
import "./
|
24
|
-
import "./
|
25
|
-
import "./Popup-0915427c.mjs";
|
26
|
-
import "./IconCross-84cb1292.mjs";
|
21
|
+
import "./Chips-8c836ba6.mjs";
|
22
|
+
import "./Dropdown-d1c81d45.mjs";
|
23
|
+
import "./Popup-0d8e1392.mjs";
|
27
24
|
import "./Popup.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
|
28
25
|
import "./Button-9e1a9284.mjs";
|
29
26
|
import "./Button.vue_vue_type_style_index_0_lang-4ed993c7.mjs";
|
30
|
-
import "./Select-
|
31
|
-
import "./
|
32
|
-
import "./
|
27
|
+
import "./Select-dab17282.mjs";
|
28
|
+
import "./Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs";
|
29
|
+
import "./reports-c579b02a.mjs";
|
30
|
+
import "./axios-33aeb810.mjs";
|
33
31
|
import "./click-outside-6101836c.mjs";
|
34
|
-
import "./auth-
|
32
|
+
import "./auth-7e39361f.mjs";
|
35
33
|
import "./IconEdit-9edfd74d.mjs";
|
36
34
|
import "./SkeletonEvent-8690422d.mjs";
|
37
|
-
import "./Feed-
|
35
|
+
import "./Feed-f7c04014.mjs";
|
38
36
|
import "./Loader-cd422786.mjs";
|
39
|
-
import "./CardBlogpost-
|
37
|
+
import "./CardBlogpost-1b81b54e.mjs";
|
40
38
|
import "./Checkbox-5dbe7b23.mjs";
|
41
|
-
import "./categories-
|
39
|
+
import "./categories-b7f9e8c0.mjs";
|
42
40
|
import "./Feed-d114330c.mjs";
|
43
|
-
import "./CardProduct-
|
44
|
-
import "./
|
45
|
-
import "./products-943fb95e.mjs";
|
41
|
+
import "./CardProduct-ea0e1f84.mjs";
|
42
|
+
import "./products-7f1e5a75.mjs";
|
46
43
|
import "./Field.vue_vue_type_style_index_0_scoped_f4a29b0d_lang-4ed993c7.mjs";
|
47
44
|
import "./inputs.validation-db65277a.mjs";
|
48
|
-
import "./BlockTags-
|
45
|
+
import "./BlockTags-00325fa0.mjs";
|
49
46
|
import "./Field-e5ad88d3.mjs";
|
50
47
|
import "./SelectMulti-58704d69.mjs";
|
51
|
-
import "./UploadImage-
|
52
|
-
import "./auth.validation-
|
53
|
-
import "./Feed-
|
54
|
-
import "./SkeletonOrganization-8690422d.mjs";
|
55
|
-
import "./dribbble-ae37c2ac.mjs";
|
48
|
+
import "./UploadImage-0e8e4278.mjs";
|
49
|
+
import "./auth.validation-f4bf1deb.mjs";
|
50
|
+
import "./Feed-35e13c22.mjs";
|
56
51
|
export {
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
52
|
+
Mt as ButtonToggleMembership,
|
53
|
+
J as CardDepartment,
|
54
|
+
xt as CardOrganization,
|
55
|
+
K as Contacts,
|
56
|
+
N as Department,
|
57
|
+
Q as DepartmentEdit,
|
58
|
+
V as DepartmentMemberModify,
|
59
|
+
W as DepartmentSub,
|
60
|
+
X as DetailsTab,
|
61
|
+
Y as Documents,
|
62
|
+
Z as EditArray,
|
63
|
+
$ as EmptyState,
|
64
|
+
tt as FeedDepartments,
|
65
|
+
rt as MembersAdd,
|
66
|
+
ot as MembersList,
|
67
|
+
it as Organization,
|
68
|
+
mt as OrganizationEdit,
|
69
|
+
bt as Organizations,
|
70
|
+
pt as OrganizationsSection,
|
71
|
+
lt as Publics,
|
72
|
+
at as Rating,
|
73
|
+
zt as Socials,
|
74
|
+
et as Unit,
|
75
|
+
st as User,
|
76
|
+
nt as departmentsStore,
|
77
|
+
dt as invitesStore,
|
78
|
+
_t as membershipsStore,
|
79
|
+
Et as organizationStore,
|
80
|
+
ft as organizationsRouter
|
86
81
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const i=require("vue");require("./auth-04684a60.js");const c=require("./axios-ceccf20e.js"),s=require("./globals-928eb13c.js"),n=c.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),t=i.reactive({all:[],current:{recommendation:!1,category:[],status:"unpublished",information:[],coverImage:"",images:[],files:[],image3d:!1,name:"",sale:0,price:0,localization:[],modifications:[],description:""}}),u={async create(e,r){const a={...r,organization:e};return await n.post("/products/create",a).then(o=>(l(o.data,"current"),Promise.resolve(o.data)),o=>(s.setError(o),Promise.reject(o)))},async read(e={}){let r={params:{}};e._id&&(r.params._id=e._id),e.category&&(r.params.category=e.category),r.params.skip=e.skip||0,r.params.limit=e.limit||10,e.organization&&(r.params.organization=e.organization),console.log(e),e.status&&(r.params.status=e.status),r.params.sort="createdAt",console.log(r);try{const a=await n.get("/products/read",{params:r.params});return e._id?t.current=a.data[0]:t.all=a.data,Promise.resolve(a.data)}catch(a){return s.setError(a),Promise.reject(a)}},async update(e,r){return await n.post("/products/"+e,r).then(a=>Promise.resolve(a.data),a=>(s.setError(a),Promise.reject(a)))},async deleteProduct(e){return await n.delete("/products/"+e).then(r=>Promise.resolve(r.data),r=>(s.setError(r),Promise.reject(r)))},async submitMood(e=null){return console.log(e),n.post("/product/recommended",{mood:e}).then(r=>(t.current=r.data.product,t.current.recommendation=r.data.recommendationText,Promise.resolve(r.data)),r=>(console.log(r),s.setError(r),Promise.reject(r)))},async fetchProducts(){return await n.get("/products/read").then(e=>(t.all=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPopular(){return await n.get("/products/popular").then(e=>(t.popular=e.data,Promise.resolve(e.data)),e=>(s.setError(e),Promise.reject(e)))},async fetchProductsPublished(){return await n.get("/products").then(e=>{let r=e.data.filter(function(a,o){return a.status!=="unpublished"});return t.all=r,t.filtered=r.slice(),t.filteredPrice=t.filtered,t.filteredPrice.sort(function(a,o){return a[t.sort.current]>o[t.sort.current]?t.sort.ascending?1:-1:a[t.sort.current]<o[t.sort.current]?t.sort.ascending?-1:1:0}),Promise.resolve(e.data)},e=>(s.setError(e),Promise.reject(e)))},async fetchProduct(e){return await n.get("/products/"+e).then(r=>(r.localization||(r.localization=[]),t.current=r.data,Promise.resolve(r.data)),r=>(s.setError(r),Promise.reject(r)))},async fetchProductPopular(){return await n.get("/products").then(e=>(t.all=e.data.slice(1,5),Promise.resolve(e.data.slice(1,5))),e=>(s.setError(e),Promise.reject(e)))}};function l(e,r){t[r]=e}i.watch(t,(e,r)=>{});exports.actions=u;exports.state=t;
|
@@ -0,0 +1,108 @@
|
|
1
|
+
import { reactive as c, watch as o } from "vue";
|
2
|
+
import "./auth-7e39361f.mjs";
|
3
|
+
import { a as u } from "./axios-33aeb810.mjs";
|
4
|
+
import { s } from "./globals-96ba60e4.mjs";
|
5
|
+
const n = u.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = c({
|
6
|
+
all: [],
|
7
|
+
current: {
|
8
|
+
recommendation: !1,
|
9
|
+
category: [],
|
10
|
+
status: "unpublished",
|
11
|
+
information: [],
|
12
|
+
coverImage: "",
|
13
|
+
images: [],
|
14
|
+
files: [],
|
15
|
+
image3d: !1,
|
16
|
+
name: "",
|
17
|
+
sale: 0,
|
18
|
+
price: 0,
|
19
|
+
localization: [],
|
20
|
+
modifications: [],
|
21
|
+
description: ""
|
22
|
+
}
|
23
|
+
}), g = {
|
24
|
+
async create(e, t) {
|
25
|
+
const a = {
|
26
|
+
...t,
|
27
|
+
organization: e
|
28
|
+
};
|
29
|
+
return await n.post("/products/create", a).then(
|
30
|
+
(i) => (d(i.data, "current"), Promise.resolve(i.data)),
|
31
|
+
(i) => (s(i), Promise.reject(i))
|
32
|
+
);
|
33
|
+
},
|
34
|
+
async read(e = {}) {
|
35
|
+
let t = { params: {} };
|
36
|
+
e._id && (t.params._id = e._id), e.category && (t.params.category = e.category), t.params.skip = e.skip || 0, t.params.limit = e.limit || 10, e.organization && (t.params.organization = e.organization), console.log(e), e.status && (t.params.status = e.status), t.params.sort = "createdAt", console.log(t);
|
37
|
+
try {
|
38
|
+
const a = await n.get("/products/read", { params: t.params });
|
39
|
+
return e._id ? r.current = a.data[0] : r.all = a.data, Promise.resolve(a.data);
|
40
|
+
} catch (a) {
|
41
|
+
return s(a), Promise.reject(a);
|
42
|
+
}
|
43
|
+
},
|
44
|
+
async update(e, t) {
|
45
|
+
return await n.post("/products/" + e, t).then(
|
46
|
+
(a) => Promise.resolve(a.data),
|
47
|
+
(a) => (s(a), Promise.reject(a))
|
48
|
+
);
|
49
|
+
},
|
50
|
+
async deleteProduct(e) {
|
51
|
+
return await n.delete("/products/" + e).then(
|
52
|
+
(t) => Promise.resolve(t.data),
|
53
|
+
(t) => (s(t), Promise.reject(t))
|
54
|
+
);
|
55
|
+
},
|
56
|
+
async submitMood(e = null) {
|
57
|
+
return console.log(e), n.post("/product/recommended", { mood: e }).then(
|
58
|
+
(t) => (r.current = t.data.product, r.current.recommendation = t.data.recommendationText, Promise.resolve(t.data)),
|
59
|
+
(t) => (console.log(t), s(t), Promise.reject(t))
|
60
|
+
);
|
61
|
+
},
|
62
|
+
async fetchProducts() {
|
63
|
+
return await n.get("/products/read").then(
|
64
|
+
(e) => (r.all = e.data, Promise.resolve(e.data)),
|
65
|
+
(e) => (s(e), Promise.reject(e))
|
66
|
+
);
|
67
|
+
},
|
68
|
+
async fetchProductsPopular() {
|
69
|
+
return await n.get("/products/popular").then(
|
70
|
+
(e) => (r.popular = e.data, Promise.resolve(e.data)),
|
71
|
+
(e) => (s(e), Promise.reject(e))
|
72
|
+
);
|
73
|
+
},
|
74
|
+
async fetchProductsPublished() {
|
75
|
+
return await n.get("/products").then(
|
76
|
+
(e) => {
|
77
|
+
let t = e.data.filter(function(a, i) {
|
78
|
+
return a.status !== "unpublished";
|
79
|
+
});
|
80
|
+
return r.all = t, r.filtered = t.slice(), r.filteredPrice = r.filtered, r.filteredPrice.sort(function(a, i) {
|
81
|
+
return a[r.sort.current] > i[r.sort.current] ? r.sort.ascending ? 1 : -1 : a[r.sort.current] < i[r.sort.current] ? r.sort.ascending ? -1 : 1 : 0;
|
82
|
+
}), Promise.resolve(e.data);
|
83
|
+
},
|
84
|
+
(e) => (s(e), Promise.reject(e))
|
85
|
+
);
|
86
|
+
},
|
87
|
+
async fetchProduct(e) {
|
88
|
+
return await n.get("/products/" + e).then(
|
89
|
+
(t) => (t.localization || (t.localization = []), r.current = t.data, Promise.resolve(t.data)),
|
90
|
+
(t) => (s(t), Promise.reject(t))
|
91
|
+
);
|
92
|
+
},
|
93
|
+
async fetchProductPopular() {
|
94
|
+
return await n.get("/products").then(
|
95
|
+
(e) => (r.all = e.data.slice(1, 5), Promise.resolve(e.data.slice(1, 5))),
|
96
|
+
(e) => (s(e), Promise.reject(e))
|
97
|
+
);
|
98
|
+
}
|
99
|
+
};
|
100
|
+
function d(e, t) {
|
101
|
+
r[t] = e;
|
102
|
+
}
|
103
|
+
o(r, (e, t) => {
|
104
|
+
});
|
105
|
+
export {
|
106
|
+
g as a,
|
107
|
+
r as s
|
108
|
+
};
|