mirror of
https://github.com/ibratabian17/OpenParty.git
synced 2026-01-15 14:22:54 -03:00
improve updateUser
This commit is contained in:
@@ -95,11 +95,10 @@ function updateUser(profileId, userProfile) {
|
||||
console.log(`[ACC] User ${profileId} not found. Creating new user.`);
|
||||
decryptedData[profileId] = userProfile; // Create a new profile
|
||||
} else {
|
||||
const currentUserData = decryptedData[profileId];
|
||||
Object.assign(currentUserData, userProfile)
|
||||
// Merge new data into the existing profile
|
||||
decryptedData[profileId] = {
|
||||
...decryptedData[profileId], // Existing data
|
||||
...userProfile // New data to override specific fields
|
||||
};
|
||||
decryptedData[profileId] = currentUserData
|
||||
}
|
||||
|
||||
// Save the updated data
|
||||
|
||||
Reference in New Issue
Block a user