Sqlx approx cost bug fixes (#975)
* function naming changed * bug fix: replacing multiple occurences of space correctly now
This commit is contained in:
parent
65882ea831
commit
05f46dd635
|
@ -138,9 +138,9 @@ const getGeneralPath = (subscriptionId: string, resourceGroup: string, name: str
|
|||
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 {
|
||||
const readRegions = new Array<string>();
|
||||
const regions = new Array<string>();
|
||||
|
||||
const response = await armRequestWithoutPolling<RegionsResponse>({
|
||||
host: configContext.ARM_ENDPOINT,
|
||||
|
@ -150,13 +150,13 @@ export const getReadRegions = async (): Promise<Array<string>> => {
|
|||
});
|
||||
|
||||
if (response.result.location !== undefined) {
|
||||
readRegions.push(response.result.location.replace(" ", "").toLowerCase());
|
||||
regions.push(response.result.location.split(" ").join("").toLowerCase());
|
||||
} else {
|
||||
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) {
|
||||
return new Array<string>();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
deleteDedicatedGatewayResource,
|
||||
getCurrentProvisioningState,
|
||||
getPriceMap,
|
||||
getReadRegions,
|
||||
getRegions,
|
||||
refreshDedicatedGatewayProvisioning,
|
||||
updateDedicatedGatewayResource,
|
||||
} from "./SqlX.rp";
|
||||
|
@ -324,7 +324,7 @@ export default class SqlX extends SelfServeBaseClass {
|
|||
hidden: true,
|
||||
});
|
||||
|
||||
regions = await getReadRegions();
|
||||
regions = await getRegions();
|
||||
priceMap = await getPriceMap(regions);
|
||||
|
||||
const response = await getCurrentProvisioningState();
|
||||
|
|
Loading…
Reference in New Issue