mirror of
https://github.com/romancm/gamebrary
synced 2024-11-27 05:30:22 +00:00
Added action for saving game board, that doesn't require active board
This commit is contained in:
parent
26f57be2fc
commit
c8182586b7
1 changed files with 15 additions and 0 deletions
|
@ -469,6 +469,21 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
SAVE_GAME_BOARD({ state }, board) {
|
||||
const db = firestore();
|
||||
|
||||
// TODO: commit mutation if we ever allow to add game directly from board
|
||||
return new Promise((resolve, reject) => {
|
||||
db.collection('boards')
|
||||
.doc(board.id)
|
||||
.set(board, { merge: true })
|
||||
.then(() => {
|
||||
resolve();
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
DELETE_BOARD({ commit }, id) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firestore();
|
||||
|
|
Loading…
Reference in a new issue