feat: search requests by endpoint in personal workspace (#4779)

Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
Pranay Pandey 2025-03-26 15:22:14 +05:30 committed by GitHub
parent d00c219401
commit b9ea5f7916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)