tango-app-api-task 3.7.37 → 3.7.39

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-task",
3
- "version": "3.7.37",
3
+ "version": "3.7.39",
4
4
  "description": "Task",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -2029,7 +2029,7 @@ export async function createChecklistTask( req, res ) {
2029
2029
  await taskQuestionService.create( question );
2030
2030
  let storeDetails;
2031
2031
  if ( inputBody?.storeName ) {
2032
- storeDetails = await storeService.findOne( { storeName: inputBody.storeName, status: 'active' }, { storeId: 1, storeProfile: 1 } );
2032
+ storeDetails = await storeService.findOne( { storeName: inputBody.storeName, status: 'active', clientId: inputBody.clientId }, { storeId: 1, storeProfile: 1 } );
2033
2033
  }
2034
2034
 
2035
2035
  let userDetails = {
@@ -2277,7 +2277,7 @@ export async function createChecklistMultiTask( req, res ) {
2277
2277
 
2278
2278
  let storeDetails;
2279
2279
  if ( originaldata?.storeName ) {
2280
- storeDetails = await storeService.findOne( { storeName: originaldata.storeName, status: 'active' }, { storeId: 1, storeProfile: 1 } );
2280
+ storeDetails = await storeService.findOne( { storeName: originaldata.storeName, status: 'active', clientId: inputBody.clientId }, { storeId: 1, storeProfile: 1 } );
2281
2281
  }
2282
2282
  let findUser = await userService.findOne( { email: originaldata.userEmail } );
2283
2283
  let userDetails = {
@@ -7093,10 +7093,7 @@ export async function AITaskCreation( req, res ) {
7093
7093
 
7094
7094
  let checklistDetails = await checklistService.findOne( { checkListType: req.body.aiType, publish: true, client_id: req.body.clientId }, { aiConfig: 1 } );
7095
7095
 
7096
- if ( !checklistDetails?.aiConfig?.autoTaskConfig?.enabled ) {
7097
- return res.sendError( 'No data found', 204 );
7098
- }
7099
- if ( !checklistDetails ) {
7096
+ if ( !checklistDetails || !checklistDetails?.aiConfig?.autoTaskConfig?.enabled ) {
7100
7097
  return res.sendError( 'No data found', 204 );
7101
7098
  }
7102
7099
  // Step:1 Store Validation
@@ -7592,6 +7589,9 @@ async function insertAItaskProcessedTaskCreation( checkTask, inputBody, date, ti
7592
7589
  oldData.questionAnswers = [ questions ];
7593
7590
  oldData.zoneName = inputBody.zoneName || '';
7594
7591
  oldData.checkListType = 'task' || '';
7592
+ if ( inputBody.streamId ) {
7593
+ oldData.streamId = inputBody?.streamId;
7594
+ }
7595
7595
  if ( inputBody.aiType ) {
7596
7596
  oldData.aiType = inputBody.aiType;
7597
7597
  }