I am creating website of student community. Having difficulty in adding Search Bar option to website. I can add normal for search but had bug for all together.
How should I add name search here?
const search = async()=> {
let input = document.querySelector(".input").value
let searchContainer = ''
const res = await getAllStudent()
let response = res.data.students
let searchTrack = response.filter(item => {
return input === item.name || parseInt(input) === item.stuId || parseInt(input) === item.circle
})
searchTrack.length > 0?
searchTrack.forEach((searchItem, index) => {
const {id,name, stuId, track, img, description, socialmedia:{linkedin, github, twitter, portfolio}} = searchItem;
let newIndex = index+id;