Skip to content

Commit

Permalink
expand type filtering for unit-tests and protofiles
Browse files Browse the repository at this point in the history
  • Loading branch information
gatzjames authored and filfreire committed Oct 17, 2024
1 parent 2ada790 commit 86ccd88
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/insomnia/src/sync/git/ne-db-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,21 @@ export class NeDBClient {
];
} else if (type !== null && id === null) {
const workspace = await db.get(models.workspace.type, this._workspaceId);
let typeFilter = [type];

const modelTypesWithinFolders = [models.request.type, models.grpcRequest.type, models.webSocketRequest.type];
const typeFilter = modelTypesWithinFolders.includes(type) ? [models.requestGroup.type, type] : [type];
if (modelTypesWithinFolders.includes(type)) {
typeFilter = [models.requestGroup.type, type];
};

if (type === models.unitTest.type) {
typeFilter = [models.unitTestSuite.type, type];
}

if (type === models.protoFile.type) {
typeFilter = [models.protoDirectory.type, type];
}

const children = await db.withDescendants(workspace, null, typeFilter);
docs = children.filter(d => d.type === type && !d.isPrivate);
} else {
Expand Down

0 comments on commit 86ccd88

Please sign in to comment.