tango-app-api-store-zone 3.3.1-beta.10 → 3.3.1-beta.12

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "tango-app-api-store-zone",
3
- "version": "3.3.1-beta.10",
3
+ "version": "3.3.1-beta.12",
4
4
  "description": "zone",
5
- "main": "app.js",
5
+ "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "start": "nodemon --exec \"eslint --fix . && node app.js\""
8
+ "start": "nodemon --exec \"eslint --fix . && node index.js\""
9
9
  },
10
10
  "engines": {
11
11
  "node": ">=18.10.0"
@@ -264,6 +264,7 @@ export const customTagListv2 = async ( req, res ) => {
264
264
  let Query = [ {
265
265
  $match: {
266
266
  client_id: req.query.clientId,
267
+ publish: true,
267
268
  checkListType: { $ne: 'custom' },
268
269
  },
269
270
  }, {
@@ -662,6 +663,7 @@ export const getCameraListv2 = async ( req, res ) => {
662
663
  camera.baseImg = cameraBaseImage;
663
664
  }
664
665
  camera.tagging = tagList;
666
+ camera.taggedCount = tagList.filter( ( ele ) => ele.tagName===req.query.tagName );
665
667
  cameraDetails[index] = camera;
666
668
  }
667
669
  cameraDetails.sort( ( a, b ) => a.tagging?.length > b.tagging?.length ? -1 : 1 );
@@ -16,6 +16,7 @@ export const validateAddTagParams = {
16
16
  export const tagSchema = joi.object( {
17
17
  clientId: joi.string().required(),
18
18
  storeId: joi.string().required(),
19
+ tagName: joi.string().optional(),
19
20
  } );
20
21
 
21
22
  export const validateTagParams = {
package/app.js DELETED
@@ -1,43 +0,0 @@
1
-
2
- import express from 'express';
3
- import { zoneTaggingRouter } from './index.js';
4
-
5
- import dotenv from 'dotenv';
6
- import { logger } from 'tango-app-api-middleware';
7
- import { connectdb } from './config/database/database.js';
8
- import responseMiddleware from './config/response/response.js';
9
- import errorMiddleware from './config/response/error.js';
10
- import pkg from 'body-parser';
11
- import cors from 'cors';
12
- // import swagger from 'swagger-ui-express';
13
- // import { swaggerConfig } from './config/swagger/swagger.js';
14
-
15
- const { json, urlencoded } = pkg;
16
-
17
- const env=dotenv.config();
18
-
19
- const app = express();
20
- const PORT = process.env.PORT || 3000;
21
-
22
-
23
- if ( env.error ) {
24
- logger.error( '.env not found' );
25
- process.exit( 1 );
26
- }
27
- app.use( cors() );
28
- app.use( responseMiddleware );
29
- app.use( errorMiddleware );
30
- app.use( json( { limit: '500mb' } ) );
31
- app.use(
32
- urlencoded( {
33
- extended: true,
34
- } ),
35
- );
36
- app.use( '/zoneTagging', zoneTaggingRouter );
37
- // app.use( '/api-docs', swagger.serve, swagger.setup( swaggerConfig ) );
38
-
39
- app.listen( PORT, () => {
40
- connectdb();
41
- } );
42
-
43
-