tango-app-api-task 3.2.1-beta-29 → 3.2.1-beta-31
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
|
@@ -2685,14 +2685,14 @@ export async function commonAiTask( req, res ) {
|
|
|
2685
2685
|
inputBody.approver = inputBody.approver.replace( /,$/, '' );
|
|
2686
2686
|
|
|
2687
2687
|
|
|
2688
|
-
|
|
2688
|
+
let title = `New Task Alert ${inputBody.taskName}-${storeDetails.storeName}-${dayjs().format( 'YYYY-MM-DD' )}`;
|
|
2689
2689
|
let time = inputBody?.scheduleEndTime || '11:59 PM';
|
|
2690
2690
|
let date = inputBody?.scheduleDate || dayjs().format( 'YYYY-MM-DD' );
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2691
|
+
let description = `A new task has been assigned to ${storeDetails.storeName}. Please complete it before the due date of ${date}.`;
|
|
2692
|
+
if ( userDetails&&userDetails.fcmToken ) {
|
|
2693
|
+
const fcmToken = userDetails.fcmToken;
|
|
2694
|
+
await sendPushNotification( title, description, fcmToken );
|
|
2695
|
+
}
|
|
2696
2696
|
const inputDateTime = dayjs.utc( `${date} ${time}`, 'YYYY-MM-DD hh:mm A' );
|
|
2697
2697
|
const currentTime = dayjs.utc();
|
|
2698
2698
|
if ( inputDateTime.isBefore( currentTime ) ) {
|
|
@@ -2717,7 +2717,7 @@ export async function commonAiTask( req, res ) {
|
|
|
2717
2717
|
return res.sendError( 'Maximum 3 referenceImage only allowed', 500 );
|
|
2718
2718
|
}
|
|
2719
2719
|
let data = {
|
|
2720
|
-
checkListName: `${inputBody.taskName}(${storeDetails.storeName}-${dayjs().format( 'YYYY-MM-DD' )}
|
|
2720
|
+
checkListName: `${inputBody.taskName}(${storeDetails.storeName}-${dayjs().format( 'YYYY-MM-DD' )})`,
|
|
2721
2721
|
checkListDescription: inputBody.taskDescription,
|
|
2722
2722
|
createdBy: creator[0]._id,
|
|
2723
2723
|
createdByName: creator[0].userName,
|
|
@@ -3102,14 +3102,14 @@ export async function createAiTask( req, res ) {
|
|
|
3102
3102
|
inputBody.userEmail = finduser.userEmail;
|
|
3103
3103
|
|
|
3104
3104
|
|
|
3105
|
-
|
|
3105
|
+
let title = `New Task Alert ${inputBody.taskName}-${storeDetails.storeName}-${dayjs().format( 'YYYY-MM-DD' )}`;
|
|
3106
3106
|
let time = inputBody?.scheduleEndTime || '11:59 PM';
|
|
3107
3107
|
let date = inputBody?.scheduleDate || dayjs().format( 'YYYY-MM-DD' );
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3108
|
+
let description = `A new task has been assigned to ${storeDetails.storeName}. Please complete it before the due date of ${date}.`;
|
|
3109
|
+
if ( userDetails&&userDetails.fcmToken ) {
|
|
3110
|
+
const fcmToken = userDetails.fcmToken;
|
|
3111
|
+
await sendPushNotification( title, description, fcmToken );
|
|
3112
|
+
}
|
|
3113
3113
|
const inputDateTime = dayjs.utc( `${date} ${time}`, 'YYYY-MM-DD hh:mm A' );
|
|
3114
3114
|
const currentTime = dayjs.utc();
|
|
3115
3115
|
if ( inputDateTime.isBefore( currentTime ) ) {
|