diff --git a/squarenotsquare/src/realm/repos/ScoreRepo.js b/squarenotsquare/src/realm/repos/ScoreRepo.js index 51c89c7..d1e70d7 100644 --- a/squarenotsquare/src/realm/repos/ScoreRepo.js +++ b/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, + ); + }); + }; } \ No newline at end of file