Added action for saving game board, that doesn't require active board

This commit is contained in:
Gamebrary 2022-05-18 18:25:26 -07:00
parent 26f57be2fc
commit c8182586b7

View file

@ -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();