Sqlx approx cost bug fixes (#975)

* function naming changed

* bug fix: replacing multiple occurences of space correctly now
This commit is contained in:
siddjoshi-ms 2021-09-08 14:04:31 -07:00 committed by GitHub
parent 65882ea831
commit 05f46dd635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -138,9 +138,9 @@ const getGeneralPath = (subscriptionId: string, resourceGroup: string, name: str
return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}`; return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}/providers/Microsoft.DocumentDB/databaseAccounts/${name}`;
}; };
export const getReadRegions = async (): Promise<Array<string>> => { export const getRegions = async (): Promise<Array<string>> => {
try { try {
const readRegions = new Array<string>(); const regions = new Array<string>();
const response = await armRequestWithoutPolling<RegionsResponse>({ const response = await armRequestWithoutPolling<RegionsResponse>({
host: configContext.ARM_ENDPOINT, host: configContext.ARM_ENDPOINT,
@ -150,13 +150,13 @@ export const getReadRegions = async (): Promise<Array<string>> => {
}); });
if (response.result.location !== undefined) { if (response.result.location !== undefined) {
readRegions.push(response.result.location.replace(" ", "").toLowerCase()); regions.push(response.result.location.split(" ").join("").toLowerCase());
} else { } else {
for (const location of response.result.locations) { for (const location of response.result.locations) {
readRegions.push(location.locationName.replace(" ", "").toLowerCase()); regions.push(location.locationName.split(" ").join("").toLowerCase());
} }
} }
return readRegions; return regions;
} catch (err) { } catch (err) {
return new Array<string>(); return new Array<string>();
} }

View File

@ -17,7 +17,7 @@ import {
deleteDedicatedGatewayResource, deleteDedicatedGatewayResource,
getCurrentProvisioningState, getCurrentProvisioningState,
getPriceMap, getPriceMap,
getReadRegions, getRegions,
refreshDedicatedGatewayProvisioning, refreshDedicatedGatewayProvisioning,
updateDedicatedGatewayResource, updateDedicatedGatewayResource,
} from "./SqlX.rp"; } from "./SqlX.rp";
@ -324,7 +324,7 @@ export default class SqlX extends SelfServeBaseClass {
hidden: true, hidden: true,
}); });
regions = await getReadRegions(); regions = await getRegions();
priceMap = await getPriceMap(regions); priceMap = await getPriceMap(regions);
const response = await getCurrentProvisioningState(); const response = await getCurrentProvisioningState();