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

123
Views
Vue js render with different request

I am making an App with vue js and laravel using API,i am getting original data , but there is an optional parameter that i want to insert in the query to render the data accordingly, if there is no parameter detected , get the original query but if the parameter is there get the data that match the parameter. i do not know how to do it with filter() and i tried to do it with axios , but it is not working

methods : {
        fetchTransactions() {
        axios.get(linkApi + "transactions/proprietaire/" + this.getProprietaireId,
        {headers : {"Authorization" : "Bearer " + this.getToken}}
        ).then((res) => {
        this.transactions = res.data
        })
    },
  },

this one below is the function i created with the optional parameter

fetchTransactionsWithMois : function(event)
    {
        console.log(event)
        axios.get(linkApi + "transactions/proprietaire/" + this.getProprietaireId + "/" + $mois,
        {headers : {"Authorization" : "Bearer " + this.getToken}}
        ).then((res) => {
            this.transactions = res.data
            console.log("trans",this.transactions)
        })
    },

this is the filter function that i talked about earlier, this one can do what i want to do but i do not know how to filter date by month with this

    filteredTransactions() {
        return this.transactions.filter( transaction => 
        transaction.proprietaire.nom.includes(this.proprietaireSelected))       
    },
}

i do not know how can i populate the data in vue js accordingly, i aldready did my research, didn't find the answer

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!