Skip to content

Commit

Permalink
Fixed delete icon function
Browse files Browse the repository at this point in the history
  • Loading branch information
elrumo committed May 14, 2021
1 parent 83c46ad commit 96af921
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
1 change: 0 additions & 1 deletion website/macos-big-sur-icons/src/components/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ var Icons = Parse.Object.extend("Icons2");
let algolia = {
// TODO: remove credentials
appid: process.env.VUE_APP_ALGOLIA_APPID,
apikey: process.env.VUE_APP_ALGOLIA_KEY
}
Expand Down
23 changes: 3 additions & 20 deletions website/macos-big-sur-icons/src/components/deleteDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,18 @@ export default {
let parent = this
let Parse = parent.Parse
console.log("icon: ", icon);
console.log("icon: ", icon.objectID)
console.log("appName: ", icon.appName);
let query = new Parse.Query(parent.Icons)
let docToDelete = await query.get(icon.objectID);
docToDelete.destroy().then(() =>{
parent.$store.dispatch('deleteItem', icon)
// Vue.delete(parent.icons[icon.usersName].icons, icon.appName) // Delete object locally
}).catch((e) =>{
console.log(e);
console.log("e: ", e);
})
// let fileRefIcns = storage.ref().child("icons_approved/"+icon.icnsFileName)
// fileRefIcns.delete().then(function() {
// console.log(icon.appName, " deleted successfully.");
// })
// .catch((error)=>{
// console.log("Uh-oh, an error occurred with: ", icon.appName, " with ID: ", icon.id);
// console.log(error);
// })
// // Delete object from Firestore
// db.collection("submissions").doc(icon.objectID).delete().then(function() {
// console.log("Document successfully deleted!");
// parent.$store.dispatch('deleteItem', icon)
// }).catch(function(error) {
// console.error("Error removing document: ", error);
// });
},
}
Expand Down
4 changes: 2 additions & 2 deletions website/macos-big-sur-icons/src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export default new Vuex.Store({
},

deleteItem(store, item){
console.log(item);
console.log(store.state.dataToShow);
// console.log(item);
// console.log(store.state.dataToShow);
let indexOf = store.state.dataToShow.indexOf(item)
store.state.dataToShow.splice(indexOf, 1);
},
Expand Down

1 comment on commit 96af921

@vercel
Copy link

@vercel vercel bot commented on 96af921 May 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.