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
10 changes: 6 additions & 4 deletions packages/das/src/api/admin.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ export class AdminController {
}> {
const repoFullName = validateRepoFullName(body?.repoFullName);

const result = await this.repoRepo.update(
{ repoFullName },
{ registered: true },
);
const result = await this.repoRepo
.createQueryBuilder()
.update()
.set({ registered: true })
.where("LOWER(repo_full_name) = LOWER(:repoFullName)", { repoFullName })
.execute();

if (!result.affected) {
throw new NotFoundException(
Expand Down
7 changes: 6 additions & 1 deletion packages/das/src/webhook/github-fetcher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ export class GitHubFetcherService implements OnModuleInit {
}

private async getTokenForRepo(repoFullName: string): Promise<string> {
const repo = await this.repoRepo.findOneBy({ repoFullName });
const repo = await this.repoRepo
.createQueryBuilder("repo")
.where("LOWER(repo.repo_full_name) = LOWER(:repoFullName)", {
repoFullName,
})
.getOne();
if (!repo?.installationId) {
throw new Error(`No installation for repo ${repoFullName}`);
}
Expand Down
Loading