feat(Search): enhance search functionality to include template descriptions (#400)

This commit is contained in:
Muhammad Rasyad Caesarardhi
2025-09-28 03:37:34 +07:00
committed by GitHub
parent 719ad62852
commit 87970b2d3b

View File

@@ -55,10 +55,11 @@ const Search = () => {
// Apply filters whenever templates, search query or selected tags change // Apply filters whenever templates, search query or selected tags change
if (templates) { if (templates) {
const filtered = templates.filter((template) => { const filtered = templates.filter((template) => {
// Filter by search query // Filter by search query - search across name and description
const matchesSearch = template.name const searchTerm = queryFromUrl.toLowerCase();
.toLowerCase() const matchesSearch =
.includes(queryFromUrl.toLowerCase()); template.name.toLowerCase().includes(searchTerm) ||
template.description.toLowerCase().includes(searchTerm);
// Filter by selected tags // Filter by selected tags
const matchesTags = const matchesTags =