Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/services/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface RepoDocument extends WithId<Document> {
url: EnvKeyedObject;
prefix: EnvKeyedObject;
search: Record<string, string>;
displayName?: string;
}

interface EnvKeyedURL {
Expand Down Expand Up @@ -59,6 +60,7 @@ export interface BranchResponse {
}

export interface RepoResponse {
displayName?: string;
repoName: string;
project: string;
search: Record<string, string>;
Expand Down Expand Up @@ -95,6 +97,7 @@ export const findAllRepos = async (options: FindOptions = {}, reqId?: string) =>
branches: 1,
url: 1,
prefix: 1,
displayName: 1,
},
};
const findOptions = { ...defaultSort, ...options, ...strictOptions };
Expand Down Expand Up @@ -152,6 +155,7 @@ const mapDocsetRepo = (docsetRepo: DocsetRepoDocument): RepoResponse => {
? mapBranches(docsetRepo.branches, getRepoUrl(docset.url[ENV_URL_KEY], docset.prefix[ENV_URL_KEY]))
: [];
return {
displayName: docsetRepo.displayName,
repoName: docsetRepo.repoName,
project: docsetRepo.project,
search: docsetRepo.search,
Expand Down
4 changes: 4 additions & 0 deletions tests/sampleData/reposBranches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const sampleReposBranches = [
{
_id: new ObjectId('5fc999ce3f17b4e8917e0494'),
repoName: 'cloud-docs',
displayName: 'MongoDB Atlas',
branches: [
{
name: 'master',
Expand Down Expand Up @@ -51,6 +52,7 @@ export const sampleReposBranches = [
{
_id: new ObjectId('5f6aaeb682989d521a60636a'),
repoName: 'docs-landing',
displayName: 'MongoDB Documentation',
branches: [
{
name: 'master',
Expand Down Expand Up @@ -94,6 +96,7 @@ export const sampleReposBranches = [
{
_id: new ObjectId('5fac1ce373a72fca02ec90c5'),
repoName: 'docs',
displayName: 'MongoDB Manual',
branches: [
{
id: new ObjectId('6447e9e7e033e0a801c80f56'),
Expand Down Expand Up @@ -349,6 +352,7 @@ export const sampleReposBranches = [
{
_id: new ObjectId('614b9f5b8d181382ca755ade'),
repoName: 'docs-mongodb-internal',
displayName: 'MongoDB Manual',
branches: [
{
id: new ObjectId('62e293ce8b1d857926ab4cca'),
Expand Down