load public boards action

This commit is contained in:
Gamebrary 2021-04-29 22:00:47 -07:00
parent 172369e15f
commit ff64e51477

View file

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