@ozdao/prometheus-framework 0.0.86 → 0.0.87
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
- package/dist/CardOrganization-ee5c34ab.js +1 -0
- package/dist/CardOrganization-f70bd169.mjs +202 -0
- package/dist/Comments-63f154a6.js +9 -0
- package/dist/Comments-c5afa4d6.mjs +459 -0
- package/dist/Feed-8fd41524.js +1 -0
- package/dist/Feed-ecf37814.mjs +367 -0
- package/dist/IconEdit-736c89be.js +1 -0
- package/dist/IconEdit-e9fd4c6c.mjs +21 -0
- package/dist/Popup-105ef2c3.js +1 -0
- package/dist/Popup-82fb2c8a.mjs +76 -0
- package/dist/Product-2f3d592f.mjs +837 -0
- package/dist/Product-2fbf9d99.js +7 -0
- package/dist/ProductEdit-20709821.mjs +349 -0
- package/dist/ProductEdit-a81d13b9.js +1 -0
- package/dist/ProfileBlogposts-eca9916c.js +1 -0
- package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
- package/dist/ProfileComments-58094a50.mjs +43 -0
- package/dist/ProfileComments-b919f021.js +1 -0
- package/dist/ProfileEvents-05485e20.js +1 -0
- package/dist/ProfileEvents-5d206e3d.mjs +55 -0
- package/dist/ProfileLikes-2f3a4488.js +1 -0
- package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
- package/dist/ProfileOrganizations-0b76e38f.js +1 -0
- package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
- package/dist/Publics-3f277c17.js +1 -0
- package/dist/Publics-9ebffff1.mjs +122 -0
- package/dist/Tab-58cd105f.mjs +46 -0
- package/dist/Tab-6f0a4909.js +1 -0
- package/dist/UploadImage-441e8526.js +1 -0
- package/dist/UploadImage-ff8f9a0c.mjs +83 -0
- package/dist/auth.client.cjs +2 -2
- package/dist/auth.client.js +60 -40
- package/dist/community.client.cjs +1 -9
- package/dist/community.client.js +367 -739
- package/dist/community.server.js +16 -4
- package/dist/community.server.mjs +16 -4
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +431 -329
- package/dist/events.server.js +19 -2
- package/dist/events.server.mjs +19 -2
- package/dist/inputs.validation-24ae76b9.js +1 -0
- package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
- package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
- package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
- package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
- package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
- package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
- package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
- package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
- package/dist/organizations-1b4c84ee.mjs +121 -0
- package/dist/organizations-af43bda4.js +1 -0
- package/dist/organizations.client-253c8068.mjs +3179 -0
- package/dist/organizations.client-c60d7659.js +3 -0
- package/dist/organizations.client.cjs +1 -3
- package/dist/organizations.client.js +49 -3025
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +10 -10
- package/package.json +1 -1
- package/src/modules/auth/router/auth.js +28 -7
- package/src/modules/community/community.client.js +1 -12
- package/src/modules/community/components/pages/BlogPost.vue +1 -1
- package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
- package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
- package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
- package/src/modules/constructor/components/sections/Constructor.vue +167 -0
- package/src/modules/events/components/blocks/CardEvent.vue +14 -6
- package/src/modules/events/components/pages/EditEvent.vue +228 -133
- package/src/modules/events/components/sections/Feed.vue +7 -1
- package/src/modules/events/controllers/events.controller.js +9 -0
- package/src/modules/events/controllers/tickets.controller.js +2 -1
- package/src/modules/events/models/event.model.js +10 -0
- package/src/modules/events/store/events.js +15 -19
- package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -3
- package/src/modules/organizations/components/sections/Publics.vue +2 -3
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
- package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
- /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
- /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
package/dist/events.server.js
CHANGED
@@ -83,7 +83,8 @@ const middlewareFactory = (db) => {
|
|
83
83
|
const matchConditions = [
|
84
84
|
...dateConditions.length > 0 ? [{ $and: dateConditions }] : [],
|
85
85
|
...req.query.url ? [{ url: req.query.url }] : [],
|
86
|
-
...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : []
|
86
|
+
...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : [],
|
87
|
+
...req.query.creator ? [{ "creator.target": new ObjectId(req.query.creator) }] : []
|
87
88
|
];
|
88
89
|
const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
|
89
90
|
console.log(dateConditions);
|
@@ -194,6 +195,7 @@ const middlewareFactory = (db) => {
|
|
194
195
|
url: 1,
|
195
196
|
cover: 1,
|
196
197
|
name: 1,
|
198
|
+
status: 1,
|
197
199
|
description: 1,
|
198
200
|
content: 1,
|
199
201
|
owner: 1,
|
@@ -241,12 +243,15 @@ const middlewareFactory = (db) => {
|
|
241
243
|
};
|
242
244
|
const create = async (req, res) => {
|
243
245
|
try {
|
246
|
+
delete req.body._id;
|
247
|
+
req.body.url = req.body.name.toLowerCase().replace(/ /g, "-").replace(/[^\w-]+/g, "");
|
244
248
|
const event = await Event.create(req.body);
|
245
249
|
if (!event) {
|
246
250
|
return res.status(404).send({ message: "Event is not created." });
|
247
251
|
}
|
248
252
|
res.status(200).send(event);
|
249
253
|
} catch (err) {
|
254
|
+
console.log(err);
|
250
255
|
return res.status(500).send({ message: err.message });
|
251
256
|
}
|
252
257
|
};
|
@@ -269,6 +274,7 @@ const middlewareFactory = (db) => {
|
|
269
274
|
}
|
270
275
|
res.status(200).send(event);
|
271
276
|
} catch (err) {
|
277
|
+
console.log(err);
|
272
278
|
return res.status(500).send({ message: err.message });
|
273
279
|
}
|
274
280
|
};
|
@@ -369,9 +375,10 @@ const controllerFactory$1 = (db) => {
|
|
369
375
|
if (!ticket) {
|
370
376
|
return res.status(404).send({ errorCode: "TICKET_NOT_FOUND" });
|
371
377
|
}
|
372
|
-
await ticket.
|
378
|
+
await Ticket.deleteOne({ _id: ticket._id });
|
373
379
|
res.status(200).send(ticket);
|
374
380
|
} catch (error) {
|
381
|
+
console.log(error);
|
375
382
|
res.status(500).send({ errorCode: "SERVER_ERROR" });
|
376
383
|
}
|
377
384
|
};
|
@@ -425,6 +432,12 @@ var event_model = (mongoose) => {
|
|
425
432
|
type: String,
|
426
433
|
required: true
|
427
434
|
},
|
435
|
+
status: {
|
436
|
+
type: String,
|
437
|
+
enum: ["draft", "published", "removed"],
|
438
|
+
default: "draft",
|
439
|
+
required: true
|
440
|
+
},
|
428
441
|
description: {
|
429
442
|
type: String,
|
430
443
|
required: true
|
@@ -461,6 +474,10 @@ var event_model = (mongoose) => {
|
|
461
474
|
}
|
462
475
|
},
|
463
476
|
creator: {
|
477
|
+
hidden: {
|
478
|
+
type: Boolean,
|
479
|
+
required: true
|
480
|
+
},
|
464
481
|
type: {
|
465
482
|
type: String,
|
466
483
|
required: true
|
package/dist/events.server.mjs
CHANGED
@@ -81,7 +81,8 @@ const middlewareFactory = (db) => {
|
|
81
81
|
const matchConditions = [
|
82
82
|
...dateConditions.length > 0 ? [{ $and: dateConditions }] : [],
|
83
83
|
...req.query.url ? [{ url: req.query.url }] : [],
|
84
|
-
...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : []
|
84
|
+
...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : [],
|
85
|
+
...req.query.creator ? [{ "creator.target": new ObjectId(req.query.creator) }] : []
|
85
86
|
];
|
86
87
|
const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
|
87
88
|
console.log(dateConditions);
|
@@ -192,6 +193,7 @@ const middlewareFactory = (db) => {
|
|
192
193
|
url: 1,
|
193
194
|
cover: 1,
|
194
195
|
name: 1,
|
196
|
+
status: 1,
|
195
197
|
description: 1,
|
196
198
|
content: 1,
|
197
199
|
owner: 1,
|
@@ -239,12 +241,15 @@ const middlewareFactory = (db) => {
|
|
239
241
|
};
|
240
242
|
const create = async (req, res) => {
|
241
243
|
try {
|
244
|
+
delete req.body._id;
|
245
|
+
req.body.url = req.body.name.toLowerCase().replace(/ /g, "-").replace(/[^\w-]+/g, "");
|
242
246
|
const event = await Event.create(req.body);
|
243
247
|
if (!event) {
|
244
248
|
return res.status(404).send({ message: "Event is not created." });
|
245
249
|
}
|
246
250
|
res.status(200).send(event);
|
247
251
|
} catch (err) {
|
252
|
+
console.log(err);
|
248
253
|
return res.status(500).send({ message: err.message });
|
249
254
|
}
|
250
255
|
};
|
@@ -267,6 +272,7 @@ const middlewareFactory = (db) => {
|
|
267
272
|
}
|
268
273
|
res.status(200).send(event);
|
269
274
|
} catch (err) {
|
275
|
+
console.log(err);
|
270
276
|
return res.status(500).send({ message: err.message });
|
271
277
|
}
|
272
278
|
};
|
@@ -367,9 +373,10 @@ const controllerFactory$1 = (db) => {
|
|
367
373
|
if (!ticket) {
|
368
374
|
return res.status(404).send({ errorCode: "TICKET_NOT_FOUND" });
|
369
375
|
}
|
370
|
-
await ticket.
|
376
|
+
await Ticket.deleteOne({ _id: ticket._id });
|
371
377
|
res.status(200).send(ticket);
|
372
378
|
} catch (error) {
|
379
|
+
console.log(error);
|
373
380
|
res.status(500).send({ errorCode: "SERVER_ERROR" });
|
374
381
|
}
|
375
382
|
};
|
@@ -423,6 +430,12 @@ var event_model = (mongoose) => {
|
|
423
430
|
type: String,
|
424
431
|
required: true
|
425
432
|
},
|
433
|
+
status: {
|
434
|
+
type: String,
|
435
|
+
enum: ["draft", "published", "removed"],
|
436
|
+
default: "draft",
|
437
|
+
required: true
|
438
|
+
},
|
426
439
|
description: {
|
427
440
|
type: String,
|
428
441
|
required: true
|
@@ -459,6 +472,10 @@ var event_model = (mongoose) => {
|
|
459
472
|
}
|
460
473
|
},
|
461
474
|
creator: {
|
475
|
+
hidden: {
|
476
|
+
type: Boolean,
|
477
|
+
required: true
|
478
|
+
},
|
462
479
|
type: {
|
463
480
|
type: String,
|
464
481
|
required: true
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const a=require("./globals-928eb13c.js");const l={ru:{validation:{length:"Содержимое должно быть не менее 1 символа.",maxLength:"Содержимое не должно превышать {maxLength} символов.",phone:"Неверный формат номера",email:"Неверный формат email",password:{minLength:"Пароль должен быть больше 8 символов",lowercase:"Должен быть символ в нижнем регистре",uppercase:"Должен быть символ в верхнем регистре",number:"Должна быть 1 цифра",specialChar:"Должен быть 1 специальный символ"}}},en:{validation:{length:"Content must be at least 1 character long.",maxLength:"Content should not exceed {maxLength} characters.",phone:"Invalid number format",email:"Invalid email format",password:{minLength:"Password must be longer than 8 characters",lowercase:"Must contain a lowercase character",uppercase:"Must contain an uppercase character",number:"Must contain at least 1 digit",specialChar:"Must contain at least 1 special character"}}}};a.i18n.global.mergeLocaleMessage("ru",l.ru);a.i18n.global.mergeLocaleMessage("en",l.en);function o(e){return e.length<1?{status:!1,message:a.i18n.global.t("validation.length")}:{status:!0,message:null}}function r(e){return console.log(e),console.log(e.valid),e.valid?{status:!0,message:null}:{status:!1,message:a.i18n.global.t("validation.phone")}}function u(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,12}$/.test(e)?{status:!0,message:null}:{status:!1,message:a.i18n.global.t("validation.email")}}function g(e){return e.length<8?{status:!1,message:a.i18n.global.t("validation.password.minLength")}:{status:!0,message:null}}async function c(e,t,n,i){if(n){const s=t(n);if(!s.status)throw e.value=s,setTimeout(()=>{e.value=null},3e3),new Error(i)}else throw e.value={status:!1,message:a.i18n.global.t("validation.length")},setTimeout(()=>{e.value=null},3e3),new Error(a.i18n.global.t("validation.length"))}exports.validateEmail=u;exports.validateInputs=c;exports.validateLength=o;exports.validatePassword=g;exports.validatePhone=r;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly ref?: any;
|
4
|
+
readonly label?: any;
|
5
|
+
readonly textarea?: any;
|
6
|
+
readonly placeholder?: any;
|
7
|
+
readonly index?: any;
|
8
|
+
readonly value?: any;
|
9
|
+
readonly content?: any;
|
10
|
+
readonly prop?: any;
|
11
|
+
readonly obj?: any;
|
12
|
+
};
|
13
|
+
$emit: (event: "focus" | "deleteBlock" | "addBlock", ...args: any[]) => void;
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
15
|
+
export default _default;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly ref?: any;
|
4
|
+
readonly label?: any;
|
5
|
+
readonly textarea?: any;
|
6
|
+
readonly placeholder?: any;
|
7
|
+
readonly index?: any;
|
8
|
+
readonly value?: any;
|
9
|
+
readonly content?: any;
|
10
|
+
readonly prop?: any;
|
11
|
+
readonly obj?: any;
|
12
|
+
};
|
13
|
+
$emit: (event: "focus" | "deleteBlock" | "addBlock", ...args: any[]) => void;
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
15
|
+
export default _default;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly ref?: any;
|
4
|
+
readonly label?: any;
|
5
|
+
readonly textarea?: any;
|
6
|
+
readonly placeholder?: any;
|
7
|
+
readonly index?: any;
|
8
|
+
readonly value?: any;
|
9
|
+
readonly content?: any;
|
10
|
+
readonly prop?: any;
|
11
|
+
readonly obj?: any;
|
12
|
+
readonly setFocus?: any;
|
13
|
+
};
|
14
|
+
$emit: (event: "focus" | "deleteBlock" | "addBlock" | "updateBlock", ...args: any[]) => void;
|
15
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
16
|
+
export default _default;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly label?: any;
|
4
|
+
readonly value?: any;
|
5
|
+
readonly prop?: any;
|
6
|
+
};
|
7
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
8
|
+
export default _default;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly label?: any;
|
4
|
+
readonly value?: any;
|
5
|
+
readonly prop?: any;
|
6
|
+
};
|
7
|
+
$emit: (event: "input" | "updateBlock", ...args: any[]) => void;
|
8
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
9
|
+
export default _default;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly placeholder?: any;
|
4
|
+
readonly index?: any;
|
5
|
+
readonly value?: any;
|
6
|
+
readonly content?: any;
|
7
|
+
readonly prop?: any;
|
8
|
+
readonly setFocus?: any;
|
9
|
+
};
|
10
|
+
$emit: (event: "focus" | "deleteBlock" | "addBlock" | "updateBlock", ...args: any[]) => void;
|
11
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
12
|
+
export default _default;
|
@@ -0,0 +1,7 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
2
|
+
$props: {
|
3
|
+
readonly content?: any;
|
4
|
+
};
|
5
|
+
$emit: (event: "update", ...args: any[]) => void;
|
6
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
7
|
+
export default _default;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
2
2
|
$props: {
|
3
3
|
readonly owner?: string | undefined;
|
4
|
+
readonly creator?: string | undefined;
|
4
5
|
readonly user?: string | number | undefined;
|
5
6
|
readonly selectedDate?: string | undefined;
|
6
7
|
readonly status?: string | undefined;
|
@@ -0,0 +1,121 @@
|
|
1
|
+
import { a as i, C as m } from "./auth-35ef1791.mjs";
|
2
|
+
import { reactive as u, watch as d } from "vue";
|
3
|
+
import { s as c } from "./globals-96ba60e4.mjs";
|
4
|
+
const t = i.create({ baseURL: process.env.API_URL, withCredentials: !0 }), s = u({
|
5
|
+
all: [],
|
6
|
+
current: {
|
7
|
+
_id: null,
|
8
|
+
profile: {
|
9
|
+
tags: [],
|
10
|
+
photo: "",
|
11
|
+
name: "",
|
12
|
+
description: ""
|
13
|
+
},
|
14
|
+
structure: [],
|
15
|
+
owner: null,
|
16
|
+
types: "",
|
17
|
+
contacts: {
|
18
|
+
email: "",
|
19
|
+
website: "",
|
20
|
+
phone: "",
|
21
|
+
address: ""
|
22
|
+
},
|
23
|
+
social: {
|
24
|
+
telegram: "",
|
25
|
+
line: "",
|
26
|
+
facebook: "",
|
27
|
+
instagram: ""
|
28
|
+
},
|
29
|
+
rating: {
|
30
|
+
popularity: 0,
|
31
|
+
median: 0,
|
32
|
+
amount: 0
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}), g = {
|
36
|
+
// Create
|
37
|
+
async create(a, e) {
|
38
|
+
a.owner = e;
|
39
|
+
try {
|
40
|
+
const r = await t.post("/api/organizations/create", a);
|
41
|
+
return console.log("Organization created successfully"), s.current = r.data, r.data;
|
42
|
+
} catch (r) {
|
43
|
+
throw console.log("Organization creation failed"), c(r), r;
|
44
|
+
}
|
45
|
+
},
|
46
|
+
// Read
|
47
|
+
async read(a = {}) {
|
48
|
+
console.log(a), a.params = a.params || {}, a.location && (a.params.location = a.location), a.country && (a.params.country = a.country), a.state && (a.params.state = a.state), a.city && (a.params.city = a.city), a.categories && (a.params.categories = a.categories), a.prices && (a.params.prices = a.prices), a.delivery && (a.params.delivery = a.delivery), a._id && (a.params = a.params || {}, a.params._id = a._id), a.types && (a.params = a.params || [], a.params.types = a.types), a.owner && (a.params = a.params || {}, a.params.owner = a.owner), a.user && (a.params = a.params || {}, a.params.user = a.user), a.member && (a.params = a.params || {}, a.params.member = a.member), a.subscriber && (a.params = a.params || {}, a.params.subscriber = a.subscriber), a.postable && (a.params = a.params || {}, a.params.postable = a.postable), a.params = a.params || {}, a.params.skip = a.skip || 0, a.params.limit = a.limit || 9, a.params.sortParam = a.sort;
|
49
|
+
try {
|
50
|
+
console.log("Request params:" + a.params);
|
51
|
+
const e = await t.get("/api/organizations", { params: a.params });
|
52
|
+
return a._id ? (console.log(e.data), Object.assign(s.current || {}, e.data[0]), console.log(s.current)) : console.log(e.data), Promise.resolve(e.data);
|
53
|
+
} catch (e) {
|
54
|
+
return c(e), Promise.reject(e);
|
55
|
+
}
|
56
|
+
},
|
57
|
+
// Update
|
58
|
+
async update(a, e) {
|
59
|
+
return console.log(a, e), await t.post(`/api/organizations/${a}/update`, e).then(
|
60
|
+
(r) => (console.log("Organization updated successfully"), Promise.resolve(r.data)),
|
61
|
+
(r) => (console.log("Updating organization failed"), Promise.reject(r))
|
62
|
+
);
|
63
|
+
},
|
64
|
+
// Remove
|
65
|
+
async remove(a) {
|
66
|
+
await t.delete(`/api/organizations/${a}/delete`).then(
|
67
|
+
(e) => {
|
68
|
+
s.error = null;
|
69
|
+
let r = m.get("user"), l = JSON.parse(r);
|
70
|
+
return l.organization = null, m.set("user", JSON.stringify(l), { expires: 7, domain: ".osi.plus", sameSite: "none", secure: !0 }), Promise.resolve(e.data);
|
71
|
+
},
|
72
|
+
(e) => (c(e), Promise.reject(e))
|
73
|
+
).catch((e) => {
|
74
|
+
c(e);
|
75
|
+
});
|
76
|
+
},
|
77
|
+
// Reset
|
78
|
+
async reset() {
|
79
|
+
s.current = {
|
80
|
+
_id: null,
|
81
|
+
profile: {
|
82
|
+
categories: [],
|
83
|
+
photo: "",
|
84
|
+
name: "",
|
85
|
+
description: ""
|
86
|
+
},
|
87
|
+
structure: [],
|
88
|
+
owner: null,
|
89
|
+
types: "",
|
90
|
+
contacts: {
|
91
|
+
email: "",
|
92
|
+
website: "",
|
93
|
+
phone: "",
|
94
|
+
address: ""
|
95
|
+
},
|
96
|
+
social: {
|
97
|
+
telegram: "",
|
98
|
+
line: "",
|
99
|
+
facebook: "",
|
100
|
+
instagram: ""
|
101
|
+
},
|
102
|
+
rating: {
|
103
|
+
popularity: 0,
|
104
|
+
median: 0,
|
105
|
+
amount: 0
|
106
|
+
}
|
107
|
+
};
|
108
|
+
}
|
109
|
+
};
|
110
|
+
d(s, (a, e) => {
|
111
|
+
});
|
112
|
+
const b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
113
|
+
__proto__: null,
|
114
|
+
actions: g,
|
115
|
+
state: s
|
116
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
117
|
+
export {
|
118
|
+
g as a,
|
119
|
+
b as o,
|
120
|
+
s
|
121
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const l=require("./auth-5aa8e90c.js"),i=require("vue"),t=require("./globals-928eb13c.js"),c=l.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),s=i.reactive({all:[],current:{_id:null,profile:{tags:[],photo:"",name:"",description:""},structure:[],owner:null,types:"",contacts:{email:"",website:"",phone:"",address:""},social:{telegram:"",line:"",facebook:"",instagram:""},rating:{popularity:0,median:0,amount:0}}}),u={async create(e,a){e.owner=a;try{const r=await c.post("/api/organizations/create",e);return console.log("Organization created successfully"),s.current=r.data,r.data}catch(r){throw console.log("Organization creation failed"),t.setError(r),r}},async read(e={}){console.log(e),e.params=e.params||{},e.location&&(e.params.location=e.location),e.country&&(e.params.country=e.country),e.state&&(e.params.state=e.state),e.city&&(e.params.city=e.city),e.categories&&(e.params.categories=e.categories),e.prices&&(e.params.prices=e.prices),e.delivery&&(e.params.delivery=e.delivery),e._id&&(e.params=e.params||{},e.params._id=e._id),e.types&&(e.params=e.params||[],e.params.types=e.types),e.owner&&(e.params=e.params||{},e.params.owner=e.owner),e.user&&(e.params=e.params||{},e.params.user=e.user),e.member&&(e.params=e.params||{},e.params.member=e.member),e.subscriber&&(e.params=e.params||{},e.params.subscriber=e.subscriber),e.postable&&(e.params=e.params||{},e.params.postable=e.postable),e.params=e.params||{},e.params.skip=e.skip||0,e.params.limit=e.limit||9,e.params.sortParam=e.sort;try{console.log("Request params:"+e.params);const a=await c.get("/api/organizations",{params:e.params});return e._id?(console.log(a.data),Object.assign(s.current||{},a.data[0]),console.log(s.current)):console.log(a.data),Promise.resolve(a.data)}catch(a){return t.setError(a),Promise.reject(a)}},async update(e,a){return console.log(e,a),await c.post(`/api/organizations/${e}/update`,a).then(r=>(console.log("Organization updated successfully"),Promise.resolve(r.data)),r=>(console.log("Updating organization failed"),Promise.reject(r)))},async remove(e){await c.delete(`/api/organizations/${e}/delete`).then(a=>{s.error=null;let r=l.Cookies.get("user"),m=JSON.parse(r);return m.organization=null,l.Cookies.set("user",JSON.stringify(m),{expires:7,domain:".osi.plus",sameSite:"none",secure:!0}),Promise.resolve(a.data)},a=>(t.setError(a),Promise.reject(a))).catch(a=>{t.setError(a)})},async reset(){s.current={_id:null,profile:{categories:[],photo:"",name:"",description:""},structure:[],owner:null,types:"",contacts:{email:"",website:"",phone:"",address:""},social:{telegram:"",line:"",facebook:"",instagram:""},rating:{popularity:0,median:0,amount:0}}}};i.watch(s,(e,a)=>{});const n=Object.freeze(Object.defineProperty({__proto__:null,actions:u,state:s},Symbol.toStringTag,{value:"Module"}));exports.actions=u;exports.organizations=n;exports.state=s;
|