Skip to content

Commit

Permalink
Fix userService errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carolynzhang18 committed Sep 23, 2024
1 parent 0537837 commit a256c8a
Show file tree
Hide file tree
Showing 5 changed files with 1,885 additions and 1,905 deletions.
2 changes: 1 addition & 1 deletion backend/models/user.mgmodel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const UserSchema: Schema = new Schema(
);

/* eslint-disable no-param-reassign */
UserSchema.set("toJSON", {
UserSchema.set("toObject", {
virtuals: true,
versionKey: false,
transform: (_doc: Document, ret: Record<string, unknown>) => {
Expand Down
12 changes: 6 additions & 6 deletions backend/services/implementations/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class UserService implements IUserService {
}

return {
...user.toJSON(),
...user.toObject(),
email: firebaseUser.email ?? "",
};
}
Expand All @@ -64,7 +64,7 @@ class UserService implements IUserService {
}

return {
...user.toJSON(),
...user.toObject(),
email: firebaseUser.email ?? "",
};
}
Expand Down Expand Up @@ -124,7 +124,7 @@ class UserService implements IUserService {
}

return {
...user.toJSON(),
...user.toObject(),
email: firebaseUser.email ?? "",
};
}),
Expand Down Expand Up @@ -177,7 +177,7 @@ class UserService implements IUserService {
}

return {
...newUser.toJSON(),
...newUser.toObject(),
email: firebaseUser.email ?? "",
};
}
Expand Down Expand Up @@ -232,7 +232,7 @@ class UserService implements IUserService {
}

return {
...oldUser.toJSON(),
...oldUser.toObject(),
firstName: user.firstName,
lastName: user.lastName,
email: updatedFirebaseUser.email ?? "",
Expand Down Expand Up @@ -331,7 +331,7 @@ class UserService implements IUserService {
}

return {
...user.toJSON(),
...user.toObject(),
email: firebaseUser.email ?? "",
};
}),
Expand Down
Loading

0 comments on commit a256c8a

Please sign in to comment.