I need to loop an array and use AXIOS in a Vue project and

Ολοκληρωμένο Αναρτήθηκε Πριν 4 χρόνια Πληρώθηκε κατά την παράδοση
Ολοκληρωμένο Πληρώθηκε κατά την παράδοση

I need to loop an array and make an axios API call to get some data returned. The loop can have 100 items in it and I don't want the loop to send another index until the axios call is done. I have tried a bunch of ways and the loop gets finished before the axios call is even started.

getSamplePMID() {

// var arr = [login to view URL]

[login to view URL] = true;

for (var index = 0; index < [login to view URL]; index++) {

let aff = [login to view URL][index]["Affiliations"].toLowerCase();

let affiliation = [login to view URL](',');

let FAU = [login to view URL][index]["Last_Name"]+ ', ' + [login to view URL][index]["First_Name"] +" " + [login to view URL][index]["MI"].slice(0, 1) + "[FAU]";

let AU = [login to view URL][index]["Last_Name"]+ ' ' + [login to view URL][index]["First_Name"].slice(0, 1) + [login to view URL][index]["MI"].slice(0, 1) + "[AU]" ;

let authorNames = "("+ FAU + " OR " + AU + ") "

let LastName = [login to view URL][index]["Last_Name"].toLowerCase()

let linkGetIdList = '[login to view URL]';

linkGetIdList += '&db=pubmed&';

linkGetIdList += 'term=' + authorNames +' AND ' + affiliation[0] + '[AD]';

[login to view URL](linkGetIdList).then((res) => {

let idlist = [login to view URL]

let passID = [login to view URL](',')

[login to view URL][index]["ORCID"] = "XXXX"

[login to view URL][index]["New_PMID"]= passID

}).catch(function(error) {

[login to view URL](error);

});

}

},

}

If you have worked with loop an array and axios then please bid if not please pass on this little project. It should be quite simple for a person who has done it before. All you have to do is to tell be how to fix my code.

Vue.js JavaScript

Ταυτότητα Εργασίας: #23978550

Σχετικά με την εργασία

2 προτάσεις Απομακρυσμένη εργασία Ενεργό Πριν 4 χρόνια

Ανατέθηκε στον:

tizmo1928

Hi, i can help you do this but the code is not very clear, message me and i'll help you fix it .

$20 USD σε 1 μέρα
(4 Αξιολογήσεις)
1.9