Estoy tratando de eliminar cierta información de Firebase y tengo algunos problemas para que funcione.
Lo que estoy tratando de hacer es hacer que el botón deleteRequest elimine los datos extraídos del enlace de búsqueda.
Este es el botón y el método.
<div class="actions"> <base-button @click="deleteRequest">Delete</base-button> </div> async deleteRequest() { await this.$store.dispatch('requests/deleteRequest', { email: this.email, message: this.message, artistId: this.$route.params.id, }); async deleteRequest(context, payload) { const removeRequest = { userEmail: payload.email, message: payload.message }; const response = await fetch(`https://find-artist-d3495-default-rtdb.firebaseio.com/requests/${payload.artistId}.json`, { method: 'DELETE', body: JSON.stringify(removeRequest) }); const responseData = response.json(); if (!response.ok) { const error = new Error(responseData.message || 'Failed to send request.'); throw error; } context.commit('deleteRequests', removeRequest); },