Change SonarqubeInfoProvider.getBaseUrl's signature
To make future changes to the API easier Signed-off-by: Neemys <36508659+Neemys@users.noreply.github.com>
This commit is contained in:
@@ -92,7 +92,9 @@ export async function createRouter(
|
||||
);
|
||||
}
|
||||
response.send({
|
||||
instanceUrl: sonarqubeInfoProvider.getBaseUrl(requestedInstanceKey),
|
||||
instanceUrl: sonarqubeInfoProvider.getBaseUrl({
|
||||
instanceName: requestedInstanceKey,
|
||||
}).baseUrl,
|
||||
});
|
||||
}) as RequestHandler<unknown, { instanceUrl: string }, unknown, { instanceKey: string }>);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export interface SonarqubeInfoProvider {
|
||||
* @param instanceName - Name of the sonarqube instance to get the info from
|
||||
* @returns the url of the instance
|
||||
*/
|
||||
getBaseUrl(instanceName: string): string;
|
||||
getBaseUrl({ instanceName }: { instanceName: string }): { baseUrl: string };
|
||||
|
||||
/**
|
||||
* Query the sonarqube instance corresponding to the instanceName to get all
|
||||
@@ -295,9 +295,9 @@ export class DefaultSonarqubeInfoProvider implements SonarqubeInfoProvider {
|
||||
* {@inheritDoc SonarqubeInfoProvider.getBaseUrl}
|
||||
* @throws Error If configuration can't be retrieved.
|
||||
*/
|
||||
getBaseUrl(instanceName: string): string {
|
||||
getBaseUrl({ instanceName }: { instanceName: string }): { baseUrl: string } {
|
||||
const instanceConfig = this.config.getInstanceConfig(instanceName ?? '');
|
||||
return instanceConfig.baseUrl;
|
||||
return { baseUrl: instanceConfig.baseUrl };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user