Use objectForPrimaryKey

This commit is contained in:
blagoev 2017-07-07 16:44:54 +03:00
parent 9ea5dd7f8c
commit 709ebd4dd5
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ exports.createAdminUser = function () {
};
Realm.open(config).then(realm => {
let pendingAdminUser = realm.objects('User').filtered(`id == "${userIdentity}"`)[0];
let pendingAdminUser = realm.objectForPrimaryKey('User', userIdentity);
realm.write(() => {
pendingAdminUser.isAdmin = true;
});