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

124
Views
How to pass ${keyWord} to config.url?

I have this line of code:

axios.get(`https://dictapi.lexicala.com/search?source=global&language=sv&text=${keyWord}`).then(

not doing its job, but it carries my input with ${keyWord}. How do I put ${keyWord} into this line of code

url: 'https://dictapi.lexicala.com/search?source=global&language=sv&text=ett',

so that when I input searching content, my config.url changes accordingly.

search =()=>{
    
    const {keyWordElement:{value:keyWord}} = this
    PubSub.publish('msg',{isFirst:false, isLoading:true}

    const axios = require('axios');

    const config = {
      
      method: 'get',
      url: 'https://dictapi.lexicala.com/search?source=global&language=sv&text=ett',
      headers: { 
        'Authorization': 'Basic xxxx'
      }
    };

    axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data)); 
    })
    .catch(function (error) {
      console.log(error);
    });

    axios.get(`https://dictapi.lexicala.com/search?source=global&language=sv&text=${keyWord}`).then(
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

use this to dynamically change your URL. url: 'https://dictapi.lexicala.com/search?source=global&language=sv&text=ett'+ keyWord

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!