mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-24 07:39:10 -04:00
Make Request switcher only show from current workspace
This commit is contained in:
1 parent
8fd7503b9b
commit
dbd4fbc991
1 file changed
+17
-2
@@ -56,13 +56,28 @@ class RequestSwitcherModal extends ModalComponent {
|
||||
}
|
||||
|
||||
_handleChange (searchString) {
|
||||
const {workspaceId} = this.props;
|
||||
|
||||
Promise.all([
|
||||
db.requestAll(),
|
||||
db.requestGroupAll()
|
||||
]).then(([
|
||||
requests,
|
||||
requestGroups
|
||||
allRequests,
|
||||
allRequestGroups
|
||||
]) => {
|
||||
// TODO: Support nested RequestGroups
|
||||
// Filter out RequestGroups that don't belong to this Workspace
|
||||
const requestGroups = allRequestGroups.filter(rg => rg.parentId === workspaceId);
|
||||
|
||||
// Filter out Requests that don't belong to this Workspace
|
||||
const requests = allRequests.filter(r => {
|
||||
if (r.parentId === workspaceId) {
|
||||
return true;
|
||||
} else {
|
||||
return !!requestGroups.find(rg => rg._id === r.parentId);
|
||||
}
|
||||
});
|
||||
|
||||
const {parentId} = this.props;
|
||||
const activeRequestGroup = requestGroups.find(rg => rg._id === parentId);
|
||||
|
||||
|
||||
Reference in new issue
Block a user