tango-app-api-trax 3.9.45 → 3.9.47

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-trax",
3
- "version": "3.9.45",
3
+ "version": "3.9.47",
4
4
  "description": "Trax",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -574,7 +574,7 @@ export const downloadInsertAI = async ( req, res ) => {
574
574
  } else {
575
575
  name = requestData?.checklistName;
576
576
  }
577
- let findchecklist = await processedcheklistconfigService.findOne( { 'checkListType': requestData.checkListType, 'client_id': requestData.clientId } ).sort( { _id: -1 } );
577
+ let findchecklist = await processedcheklistconfigService.findOne( { 'checkListType': requestData.checkListType, 'client_id': requestData.clientId }, {}, { _id: -1 } );
578
578
  // console.log( findchecklist );
579
579
  name = name + '-' + requestData.fileType;
580
580
  let insertData = {
@@ -5,8 +5,8 @@ const _methods = {
5
5
  async find( query = {}, record = {} ) {
6
6
  return model.processedchecklistconfigModel.find( query, record );
7
7
  },
8
- async findOne( query = {}, record = {} ) {
9
- return model.processedchecklistconfigModel.findOne( query, record ).sort( { updatedAt: -1 } );
8
+ async findOne( query = {}, record = {}, sort={ updatedAt: -1 } ) {
9
+ return model.processedchecklistconfigModel.findOne( query, record ).sort( sort );
10
10
  },
11
11
  async updateOne( query = {}, record = {} ) {
12
12
  return model.processedchecklistconfigModel.updateOne( query, { $set: record }, { upsert: true } );