Merge branch 'orm' into 'main'

Fix E-Mail

See merge request fedeo/backend!13
This commit is contained in:
2025-12-17 13:36:02 +00:00

View File

@@ -140,10 +140,12 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
const accounts = rows.map(row => {
const temp: any = {}
console.log(row)
Object.entries(row).forEach(([key, val]) => {
if (key.endsWith("Encrypted")) {
console.log(key,val)
if (key.endsWith("Encrypted") && val) {
// @ts-ignore
temp[key.replace("Encrypted", "")] = decrypt(val as string)
temp[key.replace("Encrypted", "")] = decrypt(val)
} else {
temp[key] = val
}
@@ -189,7 +191,7 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
const accountData: any = {}
Object.entries(row).forEach(([key, val]) => {
if (key.endsWith("Encrypted")) {
if (key.endsWith("Encrypted") && val) {
// @ts-ignore
accountData[key.replace("Encrypted", "")] = decrypt(val as string)
} else {