feat: search requests by endpoint in personal workspace (#4779)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
parent
d00c219401
commit
b9ea5f7916
1 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue