1
1
mirror of https://github.com/neosubhamoy/neosubhamoy-portfolio.git synced 2025-12-20 01:09:35 +05:30

(refactor): implemented object,array based search result categories and multi table search on backend and frontend

This commit is contained in:
2023-11-18 15:39:39 +05:30
parent 81eecae9f0
commit a36c6ffd29
4 changed files with 35 additions and 47 deletions

View File

@@ -105,7 +105,14 @@ function perform_search(searchInput, searchDef, searchRes) {
inject_no_results(response);
}
else {
inject_search_results(response);
const resultTags = [...new Set(response.map(item => item.tag))];
const result = {};
resultTags.forEach(tag => {
result[tag] = response.filter(item => item.tag === tag);
});
console.log(result);
inject_search_results(result.project);
}
},
error: function(error) {