tango-app-api-store-zone 3.3.1-beta.22 → 3.3.1-beta.23
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
|
@@ -1501,7 +1501,11 @@ export const getZoneTaggingDetails = async ( req, res ) => {
|
|
|
1501
1501
|
const matchStage = {
|
|
1502
1502
|
clientId,
|
|
1503
1503
|
};
|
|
1504
|
-
|
|
1504
|
+
let customTags = await customZoneTagService.findOne( { clientId: clientId } );
|
|
1505
|
+
const alltotalGroupCount = await customzonegrouping.count( { clientId } );
|
|
1506
|
+
if ( !customTags ) {
|
|
1507
|
+
return res.sendSuccess( { result: [], totalGroupCount: alltotalGroupCount } );
|
|
1508
|
+
}
|
|
1505
1509
|
const searchStage = searchValue ?
|
|
1506
1510
|
{
|
|
1507
1511
|
$or: [
|
|
@@ -1573,6 +1577,9 @@ export const getZoneTaggingDetails = async ( req, res ) => {
|
|
|
1573
1577
|
const [ result ] = await customZoneTagService.aggregate( pipeline );
|
|
1574
1578
|
|
|
1575
1579
|
const totalCount = result.totalCount[0]?.count || 0;
|
|
1580
|
+
if ( totalCount === 0 ) {
|
|
1581
|
+
return res.sendError( 'No data', 204 );
|
|
1582
|
+
}
|
|
1576
1583
|
const zoneList = result.filteredData;
|
|
1577
1584
|
|
|
1578
1585
|
// Get total count of groups for tabs (actual count, not filtered by search)
|
|
@@ -2145,6 +2152,12 @@ export const getZoneGroupDetails = async ( req, res ) => {
|
|
|
2145
2152
|
return res.sendError( 'clientId is required', 400 );
|
|
2146
2153
|
}
|
|
2147
2154
|
|
|
2155
|
+
|
|
2156
|
+
let groupData = await customzonegrouping.findOne( { clientId: clientId } );
|
|
2157
|
+
if ( !groupData ) {
|
|
2158
|
+
return res.sendSuccess( { result: [] } );
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2148
2161
|
const searchMatch = searchValue ?
|
|
2149
2162
|
{ groupName: { $regex: searchValue, $options: 'i' } } :
|
|
2150
2163
|
null;
|
|
@@ -2232,7 +2245,9 @@ export const getZoneGroupDetails = async ( req, res ) => {
|
|
|
2232
2245
|
const zoneGroupList = result.data || [];
|
|
2233
2246
|
|
|
2234
2247
|
const totalCount = result.totalCount[0]?.count || 0;
|
|
2235
|
-
|
|
2248
|
+
if ( totalCount === 0 ) {
|
|
2249
|
+
return res.sendError( 'No data', 204 );
|
|
2250
|
+
}
|
|
2236
2251
|
// Get total count of zones for tabs (actual count, not filtered by search)
|
|
2237
2252
|
const totalZoneCount = await customZoneTagService.count( { clientId } );
|
|
2238
2253
|
|