I have some code that deletes some data from firestore and then should reload the page. It successfully operate on the database but fails to reload the page.
Here is my function eliminaCategoria():
export async function eliminaCategoria(id, indexCategoria) {
const ristorante = doc(db, "ristoranti", id);
const docSnap = await getDoc(ristorante);
let dati = docSnap.data();
dati.categorie.splice(indexCategoria, 1);
return await setDoc(ristorante, dati);
}
And here is where the function is called:
methods: {
eliminaCategoria() {
eliminaCategoria(this.idRisto, this.IndexArr).then(() => {
this.$forceUpdate();
});
},
}
Any ideas on how to solve the issue?
Thanks in advance, Lorenzo