Skip to content

Commit

Permalink
Merge branch 'sosynpl-validation' of https://github.com/Wappizy/openc…
Browse files Browse the repository at this point in the history
…hakra into sosynpl-validation
  • Loading branch information
SeghirOumo committed Jul 16, 2024
2 parents d070846 + 393a905 commit fa60d5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/web/server/plugins/smartdiet/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2261,10 +2261,11 @@ false && cron.schedule('0 0 * * * *', async () => {
})

// Synchronize diets & customer smartagenda accounts
cron.schedule('0 0 2 * * *', () => {
cron.schedule('0 */10 * * * *', () => {
console.log(`Smartagenda accounts sync`)
return User.find({ role: { $in: [ROLE_EXTERNAL_DIET, ROLE_CUSTOMER] }, smartagenda_id: null })
return User.find({ role: {$in: [ROLE_EXTERNAL_DIET, ROLE_CUSTOMER] }, smartagenda_id: {$in: [null, '']}}).limit(100)
.then(users => {
console.log('Updating', users.map(u => [u.email, u.role]))
return Promise.allSettled(users.map(user => {
const getFn = user.role == ROLE_EXTERNAL_DIET ? getAgenda : getAccount
return getFn({ email: user.email })
Expand Down Expand Up @@ -2507,4 +2508,4 @@ exports.agendaHookFn = agendaHookFn
exports.mailjetHookFn = mailjetHookFn
exports.computeStatistics = computeStatistics
exports.canPatientStartCoaching = canPatientStartCoaching
exports.preProcessGetFORBIDDEN = preProcessGet
exports.preProcessGetFORBIDDEN = preProcessGet
1 change: 1 addition & 0 deletions studio-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"framer-motion": "^7.5.3",
"html2canvas": "^1.4.1",
"http-proxy-middleware": "^2.0.6",
"jodit-react": "^4.1.2",
"jspdf": "^2.5.1",
"jszip": "^3.10.1",
"lexical": "^0.9.0",
Expand Down

0 comments on commit fa60d5c

Please sign in to comment.