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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-client",
3
- "version": "3.0.31-dev",
3
+ "version": "3.0.33-dev",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -19,14 +19,20 @@ export async function create( req, res ) {
19
19
  const inputData = req.body;
20
20
  const countQuery = [
21
21
  {
22
- $sort: { createdAt: -1 },
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;
@@ -218,14 +218,8 @@ export function CsmUsersGet( ) {
218
218
  $match: {
219
219
  $and: [
220
220
  {
221
- $or: [
222
- {
223
- role: 'superadmin',
224
- },
225
- {
226
- role: 'admin',
227
- },
228
- ],
221
+ role: 'admin',
222
+
229
223
  },
230
224
  {
231
225
  userType: 'tango',