@ozdao/prometheus-framework 0.2.51 → 0.2.52
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main-482dc398.mjs +13626 -0
- package/dist/main-b2JI9sFg.js +91 -0
- package/dist/main-c56d4c09.js +91 -0
- package/dist/main-x-9D8zvb.mjs +13604 -0
- package/dist/main.css +1 -1
- package/dist/organizations.server.js +2 -2
- package/dist/organizations.server.mjs +2 -2
- package/dist/products.server.js +20 -7
- package/dist/products.server.mjs +20 -7
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +223 -2
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +2 -225
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +19 -19
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +76 -2
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +2 -76
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +2 -2
- package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue.js +35 -2
- package/dist/prometheus-framework/src/components/Map/Map.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue2.js +2 -35
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +44 -2
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +2 -44
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +37 -0
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/entities/IconShopcart.vue.js +21 -14
- package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconSearch.vue.js +24 -0
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +2 -11
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +11 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +49 -101
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +25 -25
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +68 -39
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +38 -48
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +69 -62
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +134 -129
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +117 -146
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +13 -13
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +44 -44
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +64 -51
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +22 -23
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +23 -23
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-6dcbb74b.mjs +55 -0
- package/dist/web-caJAdsxy.js +1 -0
- package/dist/web-ee302c1d.js +1 -0
- package/dist/web-i08OVMw9.mjs +55 -0
- package/package.json +1 -1
- package/src/components/Button/Button.vue +3 -3
- package/src/components/Feed/Feed.vue +2 -1
- package/src/components/LocationMarker/LocationMarker.vue +1 -0
- package/src/modules/applications/applications.client.js +0 -1
- package/src/modules/globals/components/blocks/BlockSearch.vue +42 -0
- package/src/modules/icons/entities/IconProfile.vue +10 -1
- package/src/modules/icons/entities/IconShopcart.vue +12 -2
- package/src/modules/marketplace/components/layouts/Marketplace.vue +7 -14
- package/src/modules/mobile/components/NavigationBar/NavigationBar.vue +27 -7
- package/src/modules/orders/components/partials/ShopCart.vue +4 -1
- package/src/modules/organizations/components/blocks/CardDepartment.vue +34 -66
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +50 -13
- package/src/modules/organizations/components/blocks/User.vue +18 -9
- package/src/modules/organizations/components/pages/Department.vue +19 -3
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +14 -10
- package/src/modules/organizations/components/pages/Organization.vue +38 -71
- package/src/modules/organizations/components/sections/Feed.vue +1 -1
- package/src/modules/organizations/controllers/memberships.controller.js +2 -2
- package/src/modules/organizations/controllers/organizations.controller.js +0 -1
- package/src/modules/products/components/pages/EditLeftover.vue +6 -4
- package/src/modules/products/components/pages/Products.vue +58 -38
- package/src/modules/products/components/sections/FilterProducts.vue +5 -5
- package/src/modules/products/controllers/leftovers.controller.js +12 -5
- package/src/modules/products/controllers/products.controller.js +18 -0
- package/src/modules/products/store/products.js +4 -0
@@ -1,47 +1,57 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="cols-2-1_3 bg-grey radius-big gap-thin
|
2
|
+
<div class="cols-2-1_3 bg-grey pd-thin radius-big gap-thin">
|
3
|
+
|
3
4
|
<FilterProducts
|
4
5
|
|
5
6
|
/>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}"
|
13
|
-
:store="{
|
14
|
-
read: (options) => products.actions.read(options),
|
15
|
-
state: products.state
|
16
|
-
}"
|
17
|
-
:options="{
|
18
|
-
limit: 15,
|
19
|
-
organization: route.params._id,
|
20
|
-
categories: route.query.categories,
|
21
|
-
prices: route.query.prices,
|
22
|
-
delivery: route.query.delivery,
|
23
|
-
// user: user
|
24
|
-
}"
|
25
|
-
v-slot="{
|
26
|
-
items
|
27
|
-
}"
|
28
|
-
class="cols-3 gap-thin"
|
29
|
-
>
|
30
|
-
<CardProduct
|
31
|
-
v-for="product in items"
|
32
|
-
:key="product._id"
|
33
|
-
:product="product"
|
34
|
-
class="h-max"
|
35
|
-
@click="$router.push({
|
36
|
-
name: 'Product Organization',
|
37
|
-
params: {
|
38
|
-
_id: route.params._id,
|
39
|
-
product: product._id
|
40
|
-
}
|
41
|
-
})"
|
7
|
+
|
8
|
+
<div>
|
9
|
+
<BlockSearch
|
10
|
+
@search="updateSearch"
|
11
|
+
placeholder="Enter product name"
|
12
|
+
class="bg-white mn-b-thin"
|
42
13
|
/>
|
43
|
-
</Feed>
|
44
14
|
|
15
|
+
<Feed
|
16
|
+
:states="{
|
17
|
+
empty: {
|
18
|
+
title: 'No Products Found',
|
19
|
+
description: 'Currently, there are no products available.'
|
20
|
+
}
|
21
|
+
}"
|
22
|
+
:store="{
|
23
|
+
read: (options) => products.actions.read(options),
|
24
|
+
state: products.state
|
25
|
+
}"
|
26
|
+
:options="{
|
27
|
+
limit: 15,
|
28
|
+
organization: route.params._id,
|
29
|
+
categories: route.query.categories,
|
30
|
+
prices: route.query.prices,
|
31
|
+
delivery: route.query.delivery,
|
32
|
+
search: route.query.search
|
33
|
+
// user: user
|
34
|
+
}"
|
35
|
+
v-slot="{
|
36
|
+
items
|
37
|
+
}"
|
38
|
+
class="cols-3 gap-thin"
|
39
|
+
>
|
40
|
+
<CardProduct
|
41
|
+
v-for="product in items"
|
42
|
+
:key="product._id"
|
43
|
+
:product="product"
|
44
|
+
class="h-max"
|
45
|
+
@click="$router.push({
|
46
|
+
name: 'Product Organization',
|
47
|
+
params: {
|
48
|
+
_id: route.params._id,
|
49
|
+
product: product._id
|
50
|
+
}
|
51
|
+
})"
|
52
|
+
/>
|
53
|
+
</Feed>
|
54
|
+
</div>
|
45
55
|
</div>
|
46
56
|
</template>
|
47
57
|
|
@@ -54,6 +64,8 @@
|
|
54
64
|
|
55
65
|
// Import components
|
56
66
|
import FilterProducts from '@pf/src/modules/products/components/sections/FilterProducts.vue'
|
67
|
+
import BlockSearch from '@pf/src/modules/globals/components/blocks/BlockSearch.vue'
|
68
|
+
|
57
69
|
|
58
70
|
import Feed from '@pf/src/components/Feed/Feed.vue'
|
59
71
|
import CardProduct from '@pf/src/modules/products/components/blocks/CardProduct.vue'
|
@@ -61,6 +73,14 @@
|
|
61
73
|
// Accessing router and store
|
62
74
|
import * as products from '@pf/src/modules/products/store/products';
|
63
75
|
|
76
|
+
function updateSearch(search) {
|
77
|
+
let query = { ...route.query}
|
78
|
+
|
79
|
+
query.search = search
|
80
|
+
|
81
|
+
router.push({ query });
|
82
|
+
}
|
83
|
+
|
64
84
|
const route = useRoute()
|
65
85
|
const router = useRouter()
|
66
86
|
</script>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<template>
|
2
|
-
<div class="pd-medium bg-
|
2
|
+
<div class="pd-medium bg-white-transp-50 radius-big">
|
3
3
|
<!-- Categories Filter -->
|
4
4
|
<Spoiler
|
5
|
-
class="radius-small o-hidden
|
5
|
+
class="radius-small o-hidden mn-b-small"
|
6
6
|
:status="true"
|
7
7
|
>
|
8
8
|
<template #header>
|
@@ -22,11 +22,11 @@
|
|
22
22
|
</template>
|
23
23
|
</Spoiler>
|
24
24
|
|
25
|
-
<hr class="mn-b-small">
|
25
|
+
<hr class="mn-b-small t-transp">
|
26
26
|
|
27
27
|
<!-- Prices Filter -->
|
28
28
|
<Spoiler
|
29
|
-
class="radius-small o-hidden
|
29
|
+
class="radius-small o-hidden mn-b-small"
|
30
30
|
:status="false"
|
31
31
|
>
|
32
32
|
<template #header>
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</template>
|
47
47
|
</Spoiler>
|
48
48
|
|
49
|
-
<hr class="mn-b-small">
|
49
|
+
<!-- <hr class="mn-b-small"> -->
|
50
50
|
|
51
51
|
<!-- Delivery Filter -->
|
52
52
|
<!-- <Spoiler
|
@@ -1,5 +1,3 @@
|
|
1
|
-
const ObjectId = require('mongoose').Types.ObjectId;
|
2
|
-
|
3
1
|
const controllerFactory = (db) => {
|
4
2
|
const Leftover = db.leftover;
|
5
3
|
|
@@ -8,16 +6,25 @@ const controllerFactory = (db) => {
|
|
8
6
|
let query = {};
|
9
7
|
let options = {};
|
10
8
|
|
11
|
-
|
9
|
+
// Проверка наличия req.query.organization
|
10
|
+
if (req.query.organization) {
|
11
|
+
// Создание ObjectId из строки
|
12
|
+
query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
|
13
|
+
}
|
14
|
+
|
15
|
+
console.log(query);
|
16
|
+
|
17
|
+
const leftoveres = await Leftover.find(query, null, options)
|
18
|
+
.sort({ createdAt: "desc" })
|
19
|
+
.exec();
|
12
20
|
|
13
|
-
const leftoveres = await Leftover.find(query, null, options).sort({ 'createdAt': 'desc' }).exec();
|
14
|
-
|
15
21
|
if (!leftoveres) {
|
16
22
|
return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
|
17
23
|
}
|
18
24
|
|
19
25
|
res.status(200).send(leftoveres);
|
20
26
|
} catch (err) {
|
27
|
+
console.error(err);
|
21
28
|
res.status(500).send({ message: "ERROR_GET_ALL_LEFTOVERES" });
|
22
29
|
}
|
23
30
|
};
|
@@ -62,6 +62,24 @@ const controllerFactory = (db) => {
|
|
62
62
|
query.delivery = { $in: deliveryOptions };
|
63
63
|
}
|
64
64
|
|
65
|
+
const search = req.query.search;
|
66
|
+
|
67
|
+
if (search) {
|
68
|
+
const parts = search.split('.');
|
69
|
+
|
70
|
+
let regexPattern = '';
|
71
|
+
|
72
|
+
if (parts.length === 2) {
|
73
|
+
// Создаем паттерн, который допускает замену одного символа в каждой части
|
74
|
+
regexPattern = parts.map(part => part.substr(0, part.length - 1) + '.{1}').join('\\.');
|
75
|
+
} else {
|
76
|
+
// Если нет точки, применяем аналогичный подход к всей строке
|
77
|
+
regexPattern = search.substr(0, search.length - 1) + '.{1}';
|
78
|
+
}
|
79
|
+
|
80
|
+
query.name = { $regex: regexPattern, $options: 'i' }
|
81
|
+
}
|
82
|
+
|
65
83
|
// Handle price ranges
|
66
84
|
const prices = req.query.prices?.split(',') || [];
|
67
85
|
|