tango-app-api-trax 3.7.59 → 3.7.60
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
|
@@ -3267,7 +3267,6 @@ export async function getStoreTaskDetails( req, res ) {
|
|
|
3267
3267
|
storeName: req.body.storeName,
|
|
3268
3268
|
isPlano: true,
|
|
3269
3269
|
planoType: { $in: [ 'fixture', 'merchRollout', 'vmRollout' ] },
|
|
3270
|
-
scheduleEndTime_iso: { $gte: new Date( dayjs().format( 'YYYY-MM-DD' ) ) },
|
|
3271
3270
|
},
|
|
3272
3271
|
},
|
|
3273
3272
|
{
|
|
@@ -3302,7 +3301,7 @@ export async function getStoreTaskDetails( req, res ) {
|
|
|
3302
3301
|
|
|
3303
3302
|
let result = {
|
|
3304
3303
|
storeId: req.body.storeName,
|
|
3305
|
-
tangoPosBlocks: info.filter( ( ele ) => ele.checklistStatus
|
|
3304
|
+
tangoPosBlocks: info.filter( ( ele ) => ele.checklistStatus != 'submit' && dayjs( ele?.scheduleEndTime_iso ).format( 'YYYY-MM-DD' ) < dayjs().format( 'YYYY-MM-DD' ) ).map( ( ele ) => {
|
|
3306
3305
|
return {
|
|
3307
3306
|
blockName: ele?.checkListName,
|
|
3308
3307
|
blockEnabled: true,
|
|
@@ -29,11 +29,11 @@ import * as cameraService from '../services/camera.service.js';
|
|
|
29
29
|
dayjs.extend( isSameOrBefore );
|
|
30
30
|
import * as pdf from 'html-pdf';
|
|
31
31
|
import handlebars from './handlebar-helper.js';
|
|
32
|
-
import fs from 'fs';
|
|
33
|
-
import { fileURLToPath } from 'url';
|
|
34
|
-
import path from 'path';
|
|
35
|
-
const __filename = fileURLToPath( import.meta.url );
|
|
36
|
-
const __dirname = path.dirname( __filename );
|
|
32
|
+
// import fs from 'fs';
|
|
33
|
+
// import { fileURLToPath } from 'url';
|
|
34
|
+
// import path from 'path';
|
|
35
|
+
// const __filename = fileURLToPath( import.meta.url );
|
|
36
|
+
// const __dirname = path.dirname( __filename );
|
|
37
37
|
|
|
38
38
|
export async function storeList( req, res ) {
|
|
39
39
|
try {
|
|
@@ -2026,9 +2026,9 @@ export async function submitChecklist( req, res ) {
|
|
|
2026
2026
|
time: updateData.submitMobileTime,
|
|
2027
2027
|
domain: JSON.parse( process.env.URL ).domain,
|
|
2028
2028
|
};
|
|
2029
|
-
const
|
|
2030
|
-
const
|
|
2031
|
-
const html =
|
|
2029
|
+
const fileContent = readFileSync( join() + '/src/hbs/flag.hbs', 'utf8' );
|
|
2030
|
+
const htmlContent = handlebars.compile( fileContent );
|
|
2031
|
+
const html = htmlContent( { data: data } );
|
|
2032
2032
|
emailList.forEach( ( email ) => {
|
|
2033
2033
|
let params = {
|
|
2034
2034
|
toEmail: email,
|
|
@@ -4617,8 +4617,7 @@ export async function downloadChecklist( req, res ) {
|
|
|
4617
4617
|
} );
|
|
4618
4618
|
} );
|
|
4619
4619
|
} );
|
|
4620
|
-
const
|
|
4621
|
-
const templateHtml = fs.readFileSync( targetFolder, 'utf8' );
|
|
4620
|
+
const templateHtml = readFileSync( join() + '/src/hbs/template.hbs', 'utf8' );
|
|
4622
4621
|
const template = handlebars.compile( templateHtml );
|
|
4623
4622
|
const html = template( { data: checklistDetails } );
|
|
4624
4623
|
pdf.create( html ).toBuffer( ( err, buffer ) => {
|
|
@@ -4636,24 +4635,24 @@ export async function downloadChecklist( req, res ) {
|
|
|
4636
4635
|
}
|
|
4637
4636
|
}
|
|
4638
4637
|
|
|
4639
|
-
async function convertUrltoBase64( url ) {
|
|
4640
|
-
|
|
4641
|
-
|
|
4638
|
+
// async function convertUrltoBase64( url ) {
|
|
4639
|
+
// try {
|
|
4640
|
+
// const response = await fetch( url );
|
|
4642
4641
|
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4642
|
+
// if ( !response.ok ) {
|
|
4643
|
+
// throw new Error( 'Failed to fetch image' );
|
|
4644
|
+
// }
|
|
4646
4645
|
|
|
4647
|
-
|
|
4648
|
-
|
|
4646
|
+
// const contentType = response.headers.get( 'content-type' );
|
|
4647
|
+
// const arrayBuffer = await response.arrayBuffer();
|
|
4649
4648
|
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4649
|
+
// const base64Image =
|
|
4650
|
+
// `data:${contentType};base64,` +
|
|
4651
|
+
// Buffer.from( arrayBuffer ).toString( 'base64' );
|
|
4653
4652
|
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
}
|
|
4653
|
+
// return base64Image;
|
|
4654
|
+
// } catch ( error ) {
|
|
4655
|
+
// // console.error( 'Error fetching image:', error.message );
|
|
4656
|
+
// return false;
|
|
4657
|
+
// }
|
|
4658
|
+
// }
|