Skip to content

Commit

Permalink
stopping profile repetition
Browse files Browse the repository at this point in the history
  • Loading branch information
RamithaHeshan33 committed Apr 28, 2024
1 parent e6ad56f commit 9241de0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scholarx/archive/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ async function getData() {

async function loadData() {
const { data } = await getData();
const mentorNames = new Set(); // Set to store unique mentor names
const mentorName = new Set(); // Set to store unique mentor names
for (let i = 0; i < data.length; i++) {
years.push(data[i].year);
industries.push(data[i].fields);
if (data[i].type == "mentor") {
// Check if the mentor's name is already in the Set
if (!mentorNames.has(data[i].name)) {
mentorNames.add(data[i].name); // Add the mentor's name to the Set
// Check if the mentor's name is already in the Set using the title
if (!mentorName.has(data[i].title)) {
mentorName.add(data[i].title); // Add the mentor's title to the Set
mentors.push(data[i]); // Add the mentor to the mentors array
}
} else {
Expand Down

0 comments on commit 9241de0

Please sign in to comment.