Fix loading the constructor for node-server-sdk

This commit is contained in:
Radu Tutueanu 2017-02-08 13:36:43 +01:00
parent 7c1dab7079
commit 716201a1fe
2 changed files with 2 additions and 2 deletions

View File

@ -45,6 +45,7 @@ module.exports = function(realmConstructor) {
let userMethods = require('./user-methods');
Object.defineProperties(realmConstructor.Sync.User, getOwnPropertyDescriptors(userMethods.static));
Object.defineProperties(realmConstructor.Sync.User.prototype, getOwnPropertyDescriptors(userMethods.instance));
Object.defineProperty(realmConstructor.Sync.User, '_realmConstructor', { value: realmConstructor });
realmConstructor.Sync.AuthError = require('./errors').AuthError;

View File

@ -179,8 +179,7 @@ module.exports = {
url.set('pathname', '/~/__management');
const realmConstructor = require('./index');
return new realmConstructor({
return new this.constructor._realmConstructor({
schema: require('./management-schema'),
sync: {
user: this,