![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.ca/private_html/scripts/ |
const { PrismaClient } = require('@prisma/client');
const fs = require('fs');
const path = require('path');
const prisma = new PrismaClient();
const photoMap = [
{ email: 'justin.wee@adwavocats.ca', base: 'justin-wee' },
{ email: 'alain.arsenault@adwavocats.com', base: 'alain-arsenault' },
{ email: 'audrey.labrecque@adwavocats.ca', base: 'audrey-labrecque' },
{ email: 'marie-claude.tremblay@adwavocats.ca', base: 'marie-claude-tremblay' },
{ email: 'david.chen@adwavocats.ca', base: 'david-chen' },
{ email: 'sophie.dubois@adwavocats.ca', base: 'sophie-dubois' },
{ email: 'marc-andre.bouchard@adwavocats.ca', base: 'marc-andre-bouchard' },
{ email: 'isabella.rodriguez@adwavocats.ca', base: 'isabella-rodriguez' },
{ email: 'thomas.leblanc@adwavocats.ca', base: 'thomas-leblanc' },
{ email: 'virginie.dufresne-lemire@adwavocats.com', base: 'virginie-dufresne-lemire' },
{ email: 'jerome.aucoin@adwavocats.com', base: 'jerome-aucoin' },
{ email: 'antoine.duranleau-hendrickx@adwavocats.com', base: 'antoine-duranleau-hendrickx' },
{ email: 'ivan.lazarov@adwavocats.com', base: 'ivan-lazarov' },
{ email: 'yalda.machouf-khadir@adwavocats.com', base: 'yalda-machouf-khadir' },
{ email: 'olivia.malenfant@adwavocats.com', base: 'olivia-malenfant' },
{ email: 'imane.melab@adwavocats.com', base: 'imane-melab' },
{ email: 'justine.monty@adwavocats.com', base: 'justine-monty' },
{ email: 'mmah.nora.toure@adwavocats.com', base: 'mmah-nora-toure' }
];
async function main() {
const missing = [];
for (const { email, base } of photoMap) {
let file = null;
if (fs.existsSync(path.join('public/images/lawyers', base + '.webp'))) {
file = base + '.webp';
} else if (fs.existsSync(path.join('public/images/lawyers', base + '.jpg'))) {
file = base + '.jpg';
}
if (file) {
await prisma.user.updateMany({
where: { email },
data: {
profilePicture: `/images/lawyers/${file}`
}
});
console.log(`Updated ${email} with photo ${file}`);
} else {
missing.push(email);
console.log(`Missing photo for ${email}`);
}
}
if (missing.length) {
console.log('\nLawyers missing photos:');
missing.forEach(e => console.log(e));
}
await prisma.$disconnect();
}
main();