diff --git a/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts b/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts index 13bd13b804..0145b9f6e4 100644 --- a/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts +++ b/polygerrit-ui/app/elements/admin/gr-repo-commands/gr-repo-commands.ts @@ -128,6 +128,7 @@ export class GrRepoCommands extends GestureEventListeners( } _handleRunningGC() { + if (!this.repo) return; this._runningGC = true; return this.restApiService .runRepoGC(this.repo) diff --git a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.ts b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.ts index 38f7780f12..907df349fb 100644 --- a/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.ts +++ b/polygerrit-ui/app/elements/shared/gr-rest-api-interface/gr-rest-api-interface.ts @@ -408,19 +408,7 @@ export class GrRestApiInterface }) as Promise; } - saveRepoConfig(repo: RepoName, config: ConfigInput): Promise; - - saveRepoConfig( - repo: RepoName, - config: ConfigInput, - errFn: ErrorCallback - ): Promise; - - saveRepoConfig( - repo: RepoName, - config: ConfigInput, - errFn?: ErrorCallback - ): Promise { + saveRepoConfig(repo: RepoName, config: ConfigInput): Promise { // TODO(kaspern): Rename rest api from /projects/ to /repos/ once backend // supports it. const url = `/projects/${encodeURIComponent(repo)}/config`; @@ -429,23 +417,11 @@ export class GrRestApiInterface method: HttpMethod.PUT, url, body: config, - errFn, anonymizedUrl: '/projects/*/config', }); } - runRepoGC(repo: RepoName): Promise; - - runRepoGC( - repo: RepoName, - errFn: ErrorCallback - ): Promise; - - runRepoGC(repo: RepoName, errFn?: ErrorCallback) { - if (!repo) { - // TODO(TS): fix return value - return ''; - } + runRepoGC(repo: RepoName): Promise { // TODO(kaspern): Rename rest api from /projects/ to /repos/ once backend // supports it. const encodeName = encodeURIComponent(repo); @@ -453,7 +429,6 @@ export class GrRestApiInterface method: HttpMethod.POST, url: `/projects/${encodeName}/gc`, body: '', - errFn, anonymizedUrl: '/projects/*/gc', }); } diff --git a/polygerrit-ui/app/services/services/gr-rest-api/gr-rest-api.ts b/polygerrit-ui/app/services/services/gr-rest-api/gr-rest-api.ts index cf064c1148..6d539a9a22 100644 --- a/polygerrit-ui/app/services/services/gr-rest-api/gr-rest-api.ts +++ b/polygerrit-ui/app/services/services/gr-rest-api/gr-rest-api.ts @@ -690,10 +690,7 @@ export interface RestApiService { includedGroup: GroupId ): Promise; - runRepoGC( - repo: RepoName, - errFn?: ErrorCallback - ): Promise; + runRepoGC(repo: RepoName): Promise; getFileContent( changeNum: NumericChangeId, path: string,