Applied suggested async and await changes

Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
This commit is contained in:
Andre Wanlin
2021-10-08 11:11:10 -05:00
parent 0b0876b0da
commit e290590517
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -18,9 +18,9 @@ import { createRouter } from '@backstage/plugin-azure-devops-backend';
import { Router } from 'express';
import type { PluginEnvironment } from '../types';
export default async function createPlugin({
export default function createPlugin({
logger,
config,
}: PluginEnvironment): Promise<Router> {
return await createRouter({ logger, config });
return createRouter({ logger, config });
}
+2 -2
View File
@@ -48,11 +48,11 @@ Here's how to get the backend up and running:
import { Router } from 'express';
import type { PluginEnvironment } from '../types';
export default async function createPlugin({
export default function createPlugin({
logger,
config,
}: PluginEnvironment): Promise<Router> {
return await createRouter({ logger, config });
return createRouter({ logger, config });
}
```
@@ -31,12 +31,12 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
this.identityApi = options.identityApi;
}
async getRepoBuilds(
getRepoBuilds(
projectName: string,
repoName: string,
top: number,
): Promise<RepoBuild[]> {
return await this.get(`repo-builds/${projectName}/${repoName}?top=${top}`);
return this.get(`repo-builds/${projectName}/${repoName}?top=${top}`);
}
private async get(path: string): Promise<any> {
@@ -53,6 +53,6 @@ export class AzureDevOpsClient implements AzureDevOpsApi {
throw new AzureDevOpsClientError(response, payload);
}
return await response.json();
return response.json() as Promise<any>;
}
}