`, methods: { removeCompany(project) { const docRef = db.collection('projects').doc(project.id); db.runTransaction((t) => { return t.get(docRef).then((doc) => { if (!doc.exists) return; var newCompanies = doc.get('companies'); newCompanies = newCompanies.filter(company => company.id != this.$root.current_company.id); t.set(docRef, { companies: newCompanies }, { merge: true }); }); }).then(function () { console.log("Transaction successfully committed!"); }).catch(function (error) { console.log("Transaction failed: ", error); }); } } }); vueApp.component('create-project', { props: ['projects', 'disabled_projects', 'company', 'success'], data() { return { project_name: '', project_description: '', buttonDisabled: false, } }, template: `