tango-app-api-store-zone 3.0.3-dev → 3.0.4-dev

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,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-store-zone",
3
- "version": "3.0.3-dev",
3
+ "version": "3.0.4-dev",
4
4
  "description": "zone",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -88,6 +88,7 @@ export const tagging = async ( req, res ) => {
88
88
  let taggingDetails = await taggingService.findOne( { clientId: InputData.clientId, storeId: InputData.storeId, cameraId: InputData.cameraId, tagName: InputData.tagName } );
89
89
  if ( !taggingDetails ) {
90
90
  await taggingService.create( InputData );
91
+ await taggingService.deleteOne( { clientId: InputData.clientId, storeId: InputData.storeId, cameraId: { $exists: false }, tagName: InputData.tagName } );
91
92
  } else {
92
93
  taggingDetails.cameraId = InputData.cameraId;
93
94
  taggingDetails.streamName = InputData.streamName;
@@ -16,6 +16,10 @@ export const deleteMany = async ( query = {} ) => {
16
16
  return await model.taggingModel.deleteMany( query );
17
17
  };
18
18
 
19
+ export const deleteOne = async ( query = {} ) => {
20
+ return await model.taggingModel.deleteOne( query );
21
+ };
22
+
19
23
  export const insertMany = async ( data = [] ) => {
20
24
  return await model.taggingModel.insertMany( data );
21
25
  };
@@ -24,6 +28,10 @@ export const updateMany = async ( query = {}, record ={} ) => {
24
28
  return await model.taggingModel.updateMany( query, record );
25
29
  };
26
30
 
31
+ export const updateOne = async ( query = {}, record ={} ) => {
32
+ return await model.taggingModel.updateOne( query, record );
33
+ };
34
+
27
35
  export const create = async ( data = [] ) => {
28
36
  return await model.taggingModel.create( data );
29
37
  };