Remove errFn from saveRepoConfig and runRepoGC
Change-Id: I57715023b0eb6b3a5d6850dd105563472131b392
This commit is contained in:
@@ -128,6 +128,7 @@ export class GrRepoCommands extends GestureEventListeners(
|
||||
}
|
||||
|
||||
_handleRunningGC() {
|
||||
if (!this.repo) return;
|
||||
this._runningGC = true;
|
||||
return this.restApiService
|
||||
.runRepoGC(this.repo)
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user