Compare commits
5 Commits
fix/env-di
...
hotfix/ful
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51e3cf0a6a | ||
|
|
21b1f385e6 | ||
|
|
c0aca81004 | ||
|
|
88bbd1a861 | ||
|
|
befbead59f |
@@ -112,7 +112,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
dockerfile: packages/hoppscotch-backend/Dockerfile
|
dockerfile: packages/hoppscotch-backend/Dockerfile
|
||||||
context: .
|
context: .
|
||||||
target: dev
|
target: prod
|
||||||
env_file:
|
env_file:
|
||||||
- ./.env
|
- ./.env
|
||||||
restart: always
|
restart: always
|
||||||
@@ -122,7 +122,7 @@ services:
|
|||||||
- PORT=3000
|
- PORT=3000
|
||||||
volumes:
|
volumes:
|
||||||
# Uncomment the line below when modifying code. Only applicable when using the "dev" target.
|
# Uncomment the line below when modifying code. Only applicable when using the "dev" target.
|
||||||
- ./packages/hoppscotch-backend/:/usr/src/app
|
# - ./packages/hoppscotch-backend/:/usr/src/app
|
||||||
- /usr/src/app/node_modules/
|
- /usr/src/app/node_modules/
|
||||||
depends_on:
|
depends_on:
|
||||||
hoppscotch-db:
|
hoppscotch-db:
|
||||||
|
|||||||
@@ -1125,7 +1125,7 @@ export class TeamCollectionService {
|
|||||||
id: searchResults[i].id,
|
id: searchResults[i].id,
|
||||||
path: !fetchedParentTree
|
path: !fetchedParentTree
|
||||||
? []
|
? []
|
||||||
: ([fetchedParentTree.right] as CollectionSearchNode[]),
|
: (fetchedParentTree.right as CollectionSearchNode[]),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1151,8 +1151,8 @@ export class TeamCollectionService {
|
|||||||
select id,title,'collection' AS type
|
select id,title,'collection' AS type
|
||||||
from "TeamCollection"
|
from "TeamCollection"
|
||||||
where "TeamCollection"."teamID"=${teamID}
|
where "TeamCollection"."teamID"=${teamID}
|
||||||
and titlesearch @@ to_tsquery(${searchQuery})
|
and titlesearch @@ plainto_tsquery(${searchQuery})
|
||||||
order by ts_rank(titlesearch,to_tsquery(${searchQuery}))
|
order by ts_rank(titlesearch,plainto_tsquery(${searchQuery}))
|
||||||
limit ${take}
|
limit ${take}
|
||||||
OFFSET ${skip === 0 ? 0 : (skip - 1) * take};
|
OFFSET ${skip === 0 ? 0 : (skip - 1) * take};
|
||||||
`;
|
`;
|
||||||
@@ -1183,8 +1183,8 @@ export class TeamCollectionService {
|
|||||||
select id,title,request->>'method' as method,'request' AS type
|
select id,title,request->>'method' as method,'request' AS type
|
||||||
from "TeamRequest"
|
from "TeamRequest"
|
||||||
where "TeamRequest"."teamID"=${teamID}
|
where "TeamRequest"."teamID"=${teamID}
|
||||||
and titlesearch @@ to_tsquery(${searchQuery})
|
and titlesearch @@ plainto_tsquery(${searchQuery})
|
||||||
order by ts_rank(titlesearch,to_tsquery(${searchQuery}))
|
order by ts_rank(titlesearch,plainto_tsquery(${searchQuery}))
|
||||||
limit ${take}
|
limit ${take}
|
||||||
OFFSET ${skip === 0 ? 0 : (skip - 1) * take};
|
OFFSET ${skip === 0 ? 0 : (skip - 1) * take};
|
||||||
`;
|
`;
|
||||||
@@ -1250,45 +1250,53 @@ export class TeamCollectionService {
|
|||||||
* @returns The parent tree of the parent collections
|
* @returns The parent tree of the parent collections
|
||||||
*/
|
*/
|
||||||
private generateParentTree(parentCollections: ParentTreeQueryReturnType[]) {
|
private generateParentTree(parentCollections: ParentTreeQueryReturnType[]) {
|
||||||
function findChildren(id) {
|
function findChildren(id: string): CollectionSearchNode[] {
|
||||||
const collection = parentCollections.filter((item) => item.id === id)[0];
|
const collection = parentCollections.filter((item) => item.id === id)[0];
|
||||||
if (collection.parentID == null) {
|
if (collection.parentID == null) {
|
||||||
return {
|
return <CollectionSearchNode[]>[
|
||||||
|
{
|
||||||
id: collection.id,
|
id: collection.id,
|
||||||
title: collection.title,
|
title: collection.title,
|
||||||
type: 'collection',
|
type: 'collection' as const,
|
||||||
path: [],
|
path: [],
|
||||||
};
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = {
|
const res = <CollectionSearchNode[]>[
|
||||||
|
{
|
||||||
id: collection.id,
|
id: collection.id,
|
||||||
title: collection.title,
|
title: collection.title,
|
||||||
type: 'collection',
|
type: 'collection' as const,
|
||||||
path: findChildren(collection.parentID),
|
path: findChildren(collection.parentID),
|
||||||
};
|
},
|
||||||
|
];
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parentCollections.length > 0) {
|
if (parentCollections.length > 0) {
|
||||||
if (parentCollections[0].parentID == null) {
|
if (parentCollections[0].parentID == null) {
|
||||||
return {
|
return <CollectionSearchNode[]>[
|
||||||
|
{
|
||||||
id: parentCollections[0].id,
|
id: parentCollections[0].id,
|
||||||
title: parentCollections[0].title,
|
title: parentCollections[0].title,
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
path: [],
|
path: [],
|
||||||
};
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return <CollectionSearchNode[]>[
|
||||||
|
{
|
||||||
id: parentCollections[0].id,
|
id: parentCollections[0].id,
|
||||||
title: parentCollections[0].title,
|
title: parentCollections[0].title,
|
||||||
type: 'collection',
|
type: 'collection',
|
||||||
path: findChildren(parentCollections[0].parentID),
|
path: findChildren(parentCollections[0].parentID),
|
||||||
};
|
},
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return <CollectionSearchNode[]>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user