Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda