Applied suggested async and await changes
Signed-off-by: Andre Wanlin <awanlin@rapidrtc.com>
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user