Many fixes n stuff
This commit is contained in:
@ -27,6 +27,11 @@ export async function loadAppData (store) {
|
||||
// })
|
||||
// }
|
||||
//
|
||||
|
||||
export function addToCollection (store, data) {
|
||||
return pb.collection(data.collection).create(data.data)
|
||||
}
|
||||
|
||||
// export function removeFromCollection (store, data) {
|
||||
// return Firebase.database().ref('/' + data.collection).once('value').then((snapshot) => {
|
||||
// let index = snapshot.val().findIndex(item =>
|
||||
@ -35,15 +40,26 @@ export async function loadAppData (store) {
|
||||
// return Firebase.database().ref('/' + data.collection + '/' + index).remove()
|
||||
// })
|
||||
// }
|
||||
export function removeFromCollection (store, data) {
|
||||
return pb.collection(data.collection).delete(data.data.id)
|
||||
}
|
||||
//
|
||||
// export function updateItem (store, data) {
|
||||
// return Firebase.database().ref(`/${data.collection}/${data.itemId}`).set(data.data)
|
||||
// }
|
||||
//
|
||||
export function updateItem (store, data) {
|
||||
return pb.collection(data.collection).update(data.data.id, data.data)
|
||||
}
|
||||
|
||||
// export function deleteItem (store, data) {
|
||||
// return Firebase.database().ref(`/${data.collection}/${data.itemId}`).set(null)
|
||||
// }
|
||||
//
|
||||
export function deleteItem (store, data) {
|
||||
return pb.collection(data.collection).delete(data.data.id)
|
||||
}
|
||||
|
||||
// export function uploadFile (store, file) {
|
||||
// return Firebase.storage().ref().child(Date.now() + file.name).put(file)
|
||||
// }
|
||||
|
Reference in New Issue
Block a user