Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

83
Views
Need help sending DELETE request with firebase Rest API with Vuex

I'm trying to delete some information from firebase and having some trouble getting it to work.

What i'm trying to do is have the deleteRequest button delete the data pulled from the fetch link.

This is the button and method

<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);
},
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!