We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The current implementation forces us to implement all the properties in User unless we set ignoreUndefinedProperties in the Firestore SDK.
User
ignoreUndefinedProperties
The User datatype contains a bunch of optional properties and it will become undefined if we reference it as our current implementation.
react-native-firebase-chat-core/src/utils.ts
Line 19 in 5a9a630
We should use spread operator instead:
export const createUserInFirestore = async (user: User) => { const { id, ...rest } = user; await firestore().collection(USERS_COLLECTION_NAME).doc(id).set({ ...rest, createdAt: firestore.FieldValue.serverTimestamp(), updatedAt: firestore.FieldValue.serverTimestamp(), }) }
It's also less code.
The text was updated successfully, but these errors were encountered:
Unsupported field value: undefined
No branches or pull requests
Issue
The current implementation forces us to implement all the properties in
User
unless we setignoreUndefinedProperties
in the Firestore SDK.Cause
The
User
datatype contains a bunch of optional properties and it will become undefined if we reference it as our current implementation.react-native-firebase-chat-core/src/utils.ts
Line 19 in 5a9a630
Suggested solution
We should use spread operator instead:
It's also less code.
The text was updated successfully, but these errors were encountered: