Enhance member management by adding postal code and contact handling

Introduced a postal code field to the member model and implemented a new MemberContact model to manage multiple phone numbers and email addresses. Updated the member service and controller to handle contact data during member creation and updates. Enhanced the MembersView component to support input for multiple contacts, ensuring better organization and accessibility of member information.
This commit is contained in:
Torsten Schulz (local)
2025-11-06 16:12:34 +01:00
parent 5a4553a8a0
commit 9cdbd60a23
8 changed files with 417 additions and 23 deletions

View File

@@ -24,10 +24,18 @@ function encryptData(data) {
}
function decryptData(data) {
const decipher = crypto.createDecipheriv('aes-256-cbc', Buffer.from(process.env.ENCRYPTION_KEY, 'hex'), Buffer.alloc(16, 0));
let decrypted = decipher.update(data, 'hex', 'utf8');
decrypted += decipher.final('utf8');
return decrypted;
if (!data || data === null || data === undefined || data === '') {
return null;
}
try {
const decipher = crypto.createDecipheriv('aes-256-cbc', Buffer.from(process.env.ENCRYPTION_KEY, 'hex'), Buffer.alloc(16, 0));
let decrypted = decipher.update(data, 'hex', 'utf8');
decrypted += decipher.final('utf8');
return decrypted;
} catch (error) {
console.error('[decryptData] Error decrypting data:', error);
return null;
}
}
export { createHash, encryptData, decryptData };