Skip to content

Commit

Permalink
DOP-4599 remove logging
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed May 10, 2024
1 parent 7086c63 commit e22f65f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/controllers/v1/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const DisplayRepoOptions = async (event: APIGatewayEvent): Promise<APIGat
const client = new mongodb.MongoClient(c.get('dbUrl'));
await client.connect();
const db = client.db(process.env.DB_NAME);
//change this to get db from env vars
const projectsRepository = new ProjectsRepository(client.db('docs_metadata'), c, consoleLogger);
const repoEntitlementRepository = new RepoEntitlementsRepository(db, c, consoleLogger);
const repoBranchesRepository = new RepoBranchesRepository(db, c, consoleLogger);
Expand All @@ -49,9 +50,8 @@ export const DisplayRepoOptions = async (event: APIGatewayEvent): Promise<APIGat
console.log(projectsRepository);
for (const repo of repos) {
const projectEntry = await projectsRepository.getProjectEntry(repo.project);
console.log(projectEntry, repo.project);
const repoOwner = projectEntry?.github?.organization;
entitledRepos.push(`${'mongodb'}/${repo.repoName}`);
entitledRepos.push(`${repoOwner}/${repo.repoName}`);
}
//add repoOwner to each of these
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/repositories/projectsRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ILogger } from '../services/logger';

export class ProjectsRepository extends BaseRepository {
constructor(db: mongodb.Db, config: IConfig, logger: ILogger) {
super(config, logger, 'ProjectsRepository', db.collection('projects'));
super(config, logger, 'ProjectsRepository', db.collection(process.env.PROJECTS_COL_NAME || 'projects'));
}

async getProjectEntry(name: string): Promise<mongodb.WithId<mongodb.BSON.Document> | null> {
Expand Down

0 comments on commit e22f65f

Please sign in to comment.