Remove errFn from saveRepoConfig and runRepoGC

Change-Id: I57715023b0eb6b3a5d6850dd105563472131b392
This commit is contained in:
Ben Rohlfs
2020-12-03 23:05:21 +01:00
parent 5ffb08ba87
commit fdbe57387e
3 changed files with 4 additions and 31 deletions

View File

@@ -128,6 +128,7 @@ export class GrRepoCommands extends GestureEventListeners(
}
_handleRunningGC() {
if (!this.repo) return;
this._runningGC = true;
return this.restApiService
.runRepoGC(this.repo)

View File

@@ -408,19 +408,7 @@ export class GrRestApiInterface
}) as Promise<DashboardInfo[] | undefined>;
}
saveRepoConfig(repo: RepoName, config: ConfigInput): Promise<Response>;
saveRepoConfig(
repo: RepoName,
config: ConfigInput,
errFn: ErrorCallback
): Promise<Response | undefined>;
saveRepoConfig(
repo: RepoName,
config: ConfigInput,
errFn?: ErrorCallback
): Promise<Response | undefined> {
saveRepoConfig(repo: RepoName, config: ConfigInput): Promise<Response> {
// 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<Response>;
runRepoGC(
repo: RepoName,
errFn: ErrorCallback
): Promise<Response | undefined>;
runRepoGC(repo: RepoName, errFn?: ErrorCallback) {
if (!repo) {
// TODO(TS): fix return value
return '';
}
runRepoGC(repo: RepoName): Promise<Response> {
// 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',
});
}

View File

@@ -690,10 +690,7 @@ export interface RestApiService {
includedGroup: GroupId
): Promise<Response>;
runRepoGC(
repo: RepoName,
errFn?: ErrorCallback
): Promise<Response | undefined>;
runRepoGC(repo: RepoName): Promise<Response>;
getFileContent(
changeNum: NumericChangeId,
path: string,