chore: remove all reference to originalFiles

This commit is contained in:
tdurieux
2024-04-27 18:04:51 +01:00
parent 3d3a03fd04
commit 17cb1f294f
4 changed files with 10 additions and 32 deletions
+2 -16
View File
@@ -24,28 +24,14 @@ export async function connect() {
return database;
}
export async function getRepository(
repoId: string,
opts: {
includeFiles: boolean;
} = {
includeFiles: true,
}
) {
export async function getRepository(repoId: string, opts: {} = {}) {
if (!repoId || repoId == "undefined") {
throw new AnonymousError("repo_not_found", {
object: repoId,
httpStatus: 404,
});
}
const project: any = {};
if (!opts.includeFiles) {
project.originalFiles = 0;
}
const data = await AnonymizedRepositoryModel.findOne(
{ repoId },
project
).collation({
const data = await AnonymizedRepositoryModel.findOne({ repoId }).collation({
locale: "en",
strength: 2,
});