tango-app-api-client 3.0.31-dev → 3.0.33-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
|
@@ -19,14 +19,20 @@ export async function create( req, res ) {
|
|
|
19
19
|
const inputData = req.body;
|
|
20
20
|
const countQuery = [
|
|
21
21
|
{
|
|
22
|
-
$sort: {
|
|
22
|
+
$sort: { tangoId: -1 },
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
$limit: 1,
|
|
26
26
|
},
|
|
27
|
+
{
|
|
28
|
+
$project: {
|
|
29
|
+
tangoId: 1,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
27
32
|
];
|
|
28
33
|
const ID = await aggregateClient( countQuery );
|
|
29
|
-
const count = ID?.tangoId || 0;
|
|
34
|
+
const count = ID[0]?.tangoId || 0;
|
|
35
|
+
logger.info( { count: count } );
|
|
30
36
|
const query = { clientName: inputData.clientName };
|
|
31
37
|
const leadRecord = await findOne( query );
|
|
32
38
|
const tangoId = count + 1;
|