From b9ea5f79161d64a2f082516d40f67e520c1cc6bb Mon Sep 17 00:00:00 2001 From: Pranay Pandey <79053599+Pranay-Pandey@users.noreply.github.com> Date: Wed, 26 Mar 2025 15:22:14 +0530 Subject: [PATCH] feat: search requests by endpoint in personal workspace (#4779) Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> --- .../src/components/collections/index.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-common/src/components/collections/index.vue b/packages/hoppscotch-common/src/components/collections/index.vue index cbf34761..8887c223 100644 --- a/packages/hoppscotch-common/src/components/collections/index.vue +++ b/packages/hoppscotch-common/src/components/collections/index.vue @@ -585,17 +585,21 @@ const filteredCollections = computed(() => { const isMatch = (text: string) => text.toLowerCase().includes(filterText) + const isRequestMatch = (request: HoppRESTRequest) => + isMatch(request.name) || isMatch(request.endpoint) + for (const collection of collections) { const filteredRequests = [] const filteredFolders = [] for (const request of collection.requests) { - if (isMatch(request.name)) filteredRequests.push(request) + if (isRequestMatch(request as HoppRESTRequest)) + filteredRequests.push(request) } for (const folder of collection.folders) { if (isMatch(folder.name)) filteredFolders.push(folder) const filteredFolderRequests = [] for (const request of folder.requests) { - if (isMatch(request.name)) filteredFolderRequests.push(request) + if (isRequestMatch(request)) filteredFolderRequests.push(request) } if (filteredFolderRequests.length > 0) { const filteredFolder = Object.assign({}, folder)