Skip to content

Commit 4e79f0e

Browse files
committed
fix (PersistenceItem) no type casting for persistence items
1 parent 787e51e commit 4e79f0e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/server-code/api/persistence-item.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
const Backendless = require('backendless');
44

55
function promisify(fn, context) {
6+
if (Backendless.promisesEnabled()) {
7+
return fn.bind(context);
8+
}
9+
610
return function() {
711
return new Promise((resolve, reject) => {
812
const args = Array.prototype.slice.call(arguments);
@@ -64,14 +68,14 @@ class PersistenceItem {
6468
* @private
6569
*/
6670
get dataStore() {
67-
return Backendless.Data.of(this.___class);
71+
return Backendless.Persistence.of(this.constructor);
6872
}
6973

7074
/**
7175
* @private
7276
*/
7377
static get dataStore() {
74-
return Backendless.Data.of(this.name);
78+
return Backendless.Persistence.of(this);
7579
}
7680

7781
/**

0 commit comments

Comments
 (0)