diff --git a/.gitignore b/.gitignore index 7e8b9e4e..b18922f1 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ lmm-oa-sws .env.test.local .env.production.local jwt.js +sample.json npm-debug.log* yarn-debug.log* diff --git a/package-lock.json b/package-lock.json index e3e89ade..eebb55b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sws2apps-api", - "version": "2.33.0", + "version": "2.33.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "sws2apps-api", - "version": "2.33.0", + "version": "2.33.1", "license": "ISC", "dependencies": { "@crowdin/crowdin-api-client": "^1.21.2", @@ -28,7 +28,7 @@ "i18next": "^22.4.10", "is-online": "^10.0.0", "jsdom": "^21.1.0", - "jw-epub-parser": "^1.32.1", + "jw-epub-parser": "^1.33.0", "node-2fa": "^2.0.3", "node-fetch": "^3.3.0", "nodemailer": "^6.9.1", @@ -8510,9 +8510,9 @@ } }, "node_modules/jw-epub-parser": { - "version": "1.32.1", - "resolved": "https://registry.npmjs.org/jw-epub-parser/-/jw-epub-parser-1.32.1.tgz", - "integrity": "sha512-oJ0wpMDDtqGZ9dhyvcPyXByXlKIqsIbHZe9hVmPnT5XcjgwzXOc4jEIUo3MrvDUNweXi26kEVo0l+I2XJDjwGg==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/jw-epub-parser/-/jw-epub-parser-1.33.0.tgz", + "integrity": "sha512-jKl4GEurpocCRI+h/VKQbpSYvbTpth5Hn1I3/JVTQsvZ430XCFAt5C72pABxe49ajhh/ZLrr18B2+fnvTH+uYQ==", "dependencies": { "dateformat": "^5.0.3", "global-jsdom": "^8.7.0", @@ -21897,9 +21897,9 @@ } }, "jw-epub-parser": { - "version": "1.32.1", - "resolved": "https://registry.npmjs.org/jw-epub-parser/-/jw-epub-parser-1.32.1.tgz", - "integrity": "sha512-oJ0wpMDDtqGZ9dhyvcPyXByXlKIqsIbHZe9hVmPnT5XcjgwzXOc4jEIUo3MrvDUNweXi26kEVo0l+I2XJDjwGg==", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/jw-epub-parser/-/jw-epub-parser-1.33.0.tgz", + "integrity": "sha512-jKl4GEurpocCRI+h/VKQbpSYvbTpth5Hn1I3/JVTQsvZ430XCFAt5C72pABxe49ajhh/ZLrr18B2+fnvTH+uYQ==", "requires": { "dateformat": "^5.0.3", "global-jsdom": "^8.7.0", diff --git a/package.json b/package.json index bf399be7..df18d6de 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "i18next": "^22.4.10", "is-online": "^10.0.0", "jsdom": "^21.1.0", - "jw-epub-parser": "^1.32.1", + "jw-epub-parser": "^1.33.0", "node-2fa": "^2.0.3", "node-fetch": "^3.3.0", "nodemailer": "^6.9.1", diff --git a/src/utils/congregation-utils.js b/src/utils/congregation-utils.js index aa11c18c..d726c903 100644 --- a/src/utils/congregation-utils.js +++ b/src/utils/congregation-utils.js @@ -4,22 +4,22 @@ import { Congregation } from '../classes/Congregation.js'; const db = getFirestore(); //get default database export const dbFetchCongregations = async () => { - const congRef = db.collection('congregations'); - const snapshot = await congRef.get(); + const congRef = db.collection('congregations'); + const snapshot = await congRef.get(); - const items = []; + const items = []; - snapshot.forEach((doc) => { - items.push(doc.id); - }); + snapshot.forEach((doc) => { + items.push(doc.id); + }); - const finalResult = []; + const finalResult = []; - for (let i = 0; i < items.length; i++) { - const cong = new Congregation(items[i]); - await cong.loadDetails(); - finalResult.push(cong); - } + for (let i = 0; i < items.length; i++) { + const cong = new Congregation(items[i]); + await cong.loadDetails(); + finalResult.push(cong); + } - return finalResult; + return finalResult; }; diff --git a/src/utils/encryption-utils.js b/src/utils/encryption-utils.js index 0ceb2637..f6830d57 100644 --- a/src/utils/encryption-utils.js +++ b/src/utils/encryption-utils.js @@ -1,8 +1,6 @@ import Cryptr from 'cryptr'; -const isProd = process.env.NODE_ENV === 'production'; - -const myKey = `&sws2apps_${isProd ? process.env.SEC_ENCRYPT_KEY : 'your-secret-encryption-string'}`; +const myKey = `&sws2apps_${process.env.SEC_ENCRYPT_KEY}`; const cryptr = new Cryptr(myKey); export const encryptData = (data) => { diff --git a/src/utils/public-utils.js b/src/utils/public-utils.js index 9e623bde..d73ce34b 100644 --- a/src/utils/public-utils.js +++ b/src/utils/public-utils.js @@ -35,6 +35,12 @@ export const fetchData = async (language) => { let monthMwb = monthOdd ? currentMonth : currentMonth - 1; let currentYear = weekDate.getFullYear(); + monthMwb = monthMwb - 2; + if (monthMwb === -1) { + monthMwb = 11; + currentYear--; + } + const issues = []; do {