We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a18b1bf commit 4a29b87Copy full SHA for 4a29b87
models/users.js
@@ -45,16 +45,12 @@ const addOrUpdate = async (userData, userId = null) => {
45
// user exists update user
46
if (user.data()) {
47
// remove id field if exist in fetched data or profileDiff
48
- const currentData = user.data();
49
- if ("id" in currentData) {
50
- delete currentData.id;
51
- }
52
if ("id" in userData) {
53
delete userData.id;
54
}
55
await userModel.doc(userId).set(
56
{
57
- ...currentData,
+ ...user.data(),
58
...userData,
59
updated_at: Date.now(),
60
},
0 commit comments