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

178
Views
vue filtering method how it works

Here's the some code i try what I did

  deleteajobewith_events(event){

     const data =event.store.readQuery({
        query: ClientJobesList,
        variables: {id:1} 
      });
    data.client.jobes.filter(jobee=>jobee.id != 101);

    console.log(data);
    event.store.writeQuery({ query: ClientJobesList, data});
 }

If I console log the 'data', it shows the same data without filtering

this is a hint about the 'data' object

 {
 "data": {
"client": {
  "id": "1",
  "client_name": "Marouane",
  "jobes": [
    {
      "id": "101",
      "title": "cbkvjk",
      "order": 88,
      "client_id": "1"
    },
  .........
    ]
  }
}
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Filter creates new array, and data must be the same type (101 is not the same as "101") so try like following:

 const data= {
  "client": {
    "id": "1",
    "client_name": "Marouane",
    "jobes": [
      {
        "id": "101",
        "title": "cbkvjk",
        "order": 88,
        "client_id": "1"
      },
      {
        "id": "102",
        "title": "aaa",
        "order": 99,
        "client_id": "2"
      },
    ]
  }
}
data.client.jobes = data.client.jobes.filter(jobee=>jobee.id !== '101');
console.log(data)

about 4 years ago · Juan Pablo Isaza Report

0

u haven't assign filtered data to previous one :

  deleteajobewith_events(event){

  const data =event.store.readQuery({
    query: ClientJobesList,
    variables: {id:1} 
   });
  data.client.jobes = data.client.jobes.filter(jobee=>jobee.id != 101);

   console.log(data);
   event.store.writeQuery({ query: ClientJobesList, 
data});
}
about 4 years ago · Juan Pablo Isaza Report
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!