diff --git a/src/routes/management/products.js b/src/routes/management/products.js index 33084ce..bee8b1a 100644 --- a/src/routes/management/products.js +++ b/src/routes/management/products.js @@ -16,6 +16,7 @@ const listAllowedFilters = [ 'price', 'margin', 'priceWithTax', + 'tags', 'createdAt', 'updatedAt', '_reference', @@ -33,7 +34,7 @@ const listAllowedSorters = [ 'priceWithTax', 'updatedAt', ]; -const propertiesAllowedFilters = []; +const propertiesAllowedFilters = ['tags']; import { listProductsRouteHandler, getProductRouteHandler, diff --git a/src/routes/sales/clients.js b/src/routes/sales/clients.js index 8799a3d..1ac7357 100644 --- a/src/routes/sales/clients.js +++ b/src/routes/sales/clients.js @@ -5,7 +5,15 @@ import { getFilter, convertPropertiesString, getSort } from '../../utils.js'; const router = express.Router(); -const listAllowedFilters = ['country', 'active', 'createdAt', 'updatedAt', 'name', '_reference']; +const listAllowedFilters = [ + 'country', + 'active', + 'tags', + 'createdAt', + 'updatedAt', + 'name', + '_reference', +]; const listAllowedSorters = [ 'name', 'country', @@ -16,7 +24,7 @@ const listAllowedSorters = [ 'updatedAt', '_id', ]; -const propertiesAllowedFilters = ['country', 'active', 'createdAt', 'updatedAt']; +const propertiesAllowedFilters = ['country', 'active', 'tags', 'createdAt', 'updatedAt']; import { listClientsRouteHandler, getClientRouteHandler, diff --git a/src/utils.js b/src/utils.js index c8b6c69..3b1a9f0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1404,7 +1404,7 @@ function filterDistributeKeys(value, keys = DISTRIBUTE_KEYS) { } async function distributeUpdate(value, id, type) { - await natsServer.publish(`${type}s.${id}.object`, value); + await natsServer.publish(`${type}s.${id}.object`, { ...value, _id: id }); } async function distributeStats(value, type) {