Skip to content

Commit

Permalink
Utilisation des enfants de lodash plutôt que lui même
Browse files Browse the repository at this point in the history
  • Loading branch information
NerOcrO committed Jul 22, 2024
1 parent 9f330c1 commit 67ddbcf
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 26 deletions.
24 changes: 17 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"joi": "17.12.1",
"json2csv": "5.0.6",
"jwt-decode": "4.0.0",
"lodash": "4.17.21",
"lodash.capitalize": "^4.2.1",
"lodash.isequal": "^4.5.0",
"lodash.merge": "^4.6.2",
"mjml": "4.15.3",
"moment": "2.30.1",
"mongodb": "3.7.4",
Expand Down
4 changes: 2 additions & 2 deletions src/mailer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const Joi = require('joi');
const _ = require('lodash');
const merge = require('lodash.merge');
const htmlToText = require('nodemailer-html-to-text').htmlToText;
const nodemailer = require('nodemailer');
const moment = require('moment');
Expand Down Expand Up @@ -98,7 +98,7 @@ module.exports = app => {
body: Joi.string().required(),
}, { abortEarly: false });
let { subject, body } = schema.validate(message).value;
return transporter.sendMail(_.merge({}, {
return transporter.sendMail(merge({}, {
to: emailAddress,
subject,
from: `Conseiller Numérique <${configuration.from}>`,
Expand Down
4 changes: 2 additions & 2 deletions src/tools/admin/admins/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendActivationCompteEmails = require('./tasks/sendCreateAccountEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -18,7 +18,7 @@ execute(__filename, async ({ logger, db, app, emails }) => {

logger.info('Envoi de l\'email de création de compte aux admins...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/admin/candidats/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendActivationCompteEmails = require('./tasks/sendCreateAccountEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -19,7 +19,7 @@ execute(__filename, async ({ logger, db, app, emails, Sentry }) => {

logger.info('Envoi de l\'email de création de compte aux conseillers...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/admin/conseillers/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendActivationCompteEmails = require('./tasks/sendCreateAccountEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -19,7 +19,7 @@ execute(__filename, async ({ logger, db, app, emails, Sentry }) => {

logger.info('Envoi de l\'email de création de compte aux conseillers...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendCandidatEmail = require('./tasks/sendCandidatEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -18,7 +18,7 @@ execute(__filename, async ({ logger, db, app, emails, Sentry, exit }) => {

logger.info('Envoi de l\'email de point sur le recrutement du candidat...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/admin/conseillers/fix-mises-en-relation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { execute } = require('../../utils');
const { isEqual } = require('lodash');
const isEqual = require('lodash.isequal');
const { program } = require('commander');

execute(__filename, async ({ db, logger, exit }) => {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/admin/prefets/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendActivationCompteEmails = require('./tasks/sendCreateAccountEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -19,7 +19,7 @@ execute(__filename, async ({ logger, db, app, emails, Sentry }) => {

logger.info('Envoi de l\'email de création de compte aux utilisateurs en préfecture...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down
4 changes: 2 additions & 2 deletions src/tools/admin/structures/account/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendActivationCompteEmails = require('./tasks/sendCreateAccountEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -18,7 +18,7 @@ execute(__filename, async ({ logger, db, app, emails, Sentry }) => {
let { type = 'send', siret, limit = 1, delay = 100 } = program.opts();
logger.info('Envoi de l\'email de création de compte aux structures...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/admin/structures/fix-statut-email-structure.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { execute } = require('../../utils');
const { isEqual } = require('lodash');
const isEqual = require('lodash.isequal');

execute(__filename, async ({ db, logger, exit }) => {
let promises = [];
Expand Down
4 changes: 2 additions & 2 deletions src/tools/admin/structures/relance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

const { program } = require('commander');
const _ = require('lodash');
const capitalize = require('lodash.capitalize');
const sendActivationCompteEmails = require('./tasks/sendCreateAccountEmail');
const { capitalizeFirstLetter, execute } = require('../../../utils');

Expand All @@ -19,7 +19,7 @@ execute(__filename, async ({ logger, db, app, emails, Sentry }) => {

logger.info('Envoi de l\'email de relance de création de compte aux structures...');

let ActionClass = require(`./tasks/actions/${_.capitalize(type)}Action`);
let ActionClass = require(`./tasks/actions/${capitalize(type)}Action`);
let action = new ActionClass(app);

try {
Expand Down

0 comments on commit 67ddbcf

Please sign in to comment.