Updated removeUserData

This commit is contained in:
Mustafa Buyukcelebi 2019-08-23 13:58:03 +03:00
parent e5aeb71f8e
commit 6cdbc823d4

View File

@ -193,10 +193,7 @@ export const updateUserData = userData =>
export const removeUserData = username => export const removeUserData = username =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
try { try {
const account = Object.assign( const account = Array.from(realm.objects(USER_SCHEMA).filtered('username = $0', username));
[],
Array.from(realm.objects(USER_SCHEMA).filtered('username = $0', username)),
);
if (convertToArray(account).length > 0) { if (convertToArray(account).length > 0) {
realm.write(() => { realm.write(() => {
realm.delete(account); realm.delete(account);