Browse Source

create score object

pull/8/head
Tim Glasgow 2 years ago
parent
commit
d938a7b62b
  1. 16
      squarenotsquare/src/realm/repos/ScoreRepo.js

16
squarenotsquare/src/realm/repos/ScoreRepo.js

@ -8,4 +8,20 @@ export default class ScoreRepo {
constructor(db) {
this.realmDB = db;
}
createScore = (user, score) => {
let scoreID = uuidv4();
this.realmDB.write(() => {
this.realmDB.create(
ScoreEntity.name,
{
id: scoreID,
user: user,
value: score,
},
true,
);
});
};
}
Loading…
Cancel
Save