mirror of
https://github.com/romancm/gamebrary
synced 2024-11-27 13:40:48 +00:00
load public boards action
This commit is contained in:
parent
172369e15f
commit
ff64e51477
1 changed files with 17 additions and 0 deletions
|
@ -210,6 +210,23 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
LOAD_USER_PUBLIC_BOARDS(context, userId) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
||||
db.collection('boards')
|
||||
.where('owner', '==', userId)
|
||||
.where('isPublic', '==', true)
|
||||
.get()
|
||||
.then((querySnapshot) => {
|
||||
const boards = querySnapshot.docs.map(doc => doc.data());
|
||||
|
||||
resolve(boards);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
},
|
||||
|
||||
DELETE_PROFILE({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const db = firebase.firestore();
|
||||
|
|
Loading…
Reference in a new issue