Skip to content

Commit 7f79258

Browse files
committed
fix: don't modify URLs when creating repos and other cleanup
1 parent 864ac4e commit 7f79258

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/db/mongo/repo.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ export const getRepos = async (query: any = {}): Promise<Repo[]> => {
1414
};
1515

1616
export const getRepo = async (name: string): Promise<Repo | null> => {
17-
name = name.toLowerCase();
1817
const collection = await connect(collectionName);
19-
const doc = await collection.findOne({ name: { $eq: name } });
18+
const doc = await collection.findOne({ name: { $eq: name.toLowerCase() } });
2019
return doc ? toClass(doc, Repo.prototype) : null;
2120
};
2221

2322
export const getRepoByUrl = async (repoUrl: string): Promise<Repo | null> => {
2423
const collection = await connect(collectionName);
25-
const doc = await collection.findOne({ url: { $eq: repoUrl.toLowerCase() } });
24+
const doc = await collection.findOne({ url: { $eq: repoUrl } });
2625
return doc ? toClass(doc, Repo.prototype) : null;
2726
};
2827

0 commit comments

Comments
 (0)