From c7c0a3a979a5057f2e6ac68233d1f8153b78ff7d Mon Sep 17 00:00:00 2001 From: Tara Zou Date: Fri, 26 Apr 2024 15:12:11 -0400 Subject: [PATCH] fix format --- src/ConfigContext.ts | 1 - src/SelfServe/SqlX/SqlX.rp.ts | 19 ++++++++----------- src/SelfServe/SqlX/SqlxTypes.ts | 10 +++++----- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/ConfigContext.ts b/src/ConfigContext.ts index 64e53dc9c..712aadd43 100644 --- a/src/ConfigContext.ts +++ b/src/ConfigContext.ts @@ -254,4 +254,3 @@ export async function initializeConfiguration(): Promise { } export { configContext }; - diff --git a/src/SelfServe/SqlX/SqlX.rp.ts b/src/SelfServe/SqlX/SqlX.rp.ts index 78293324c..22f537731 100644 --- a/src/SelfServe/SqlX/SqlX.rp.ts +++ b/src/SelfServe/SqlX/SqlX.rp.ts @@ -170,15 +170,15 @@ export const getRegions = async (): Promise> => { } }; -export const getRegionShortName = async (regionDisplayName: string) : Promise => { +export const getRegionShortName = async (regionDisplayName: string): Promise => { const locationsList = await get(userContext.subscriptionId, regionDisplayName); - if ('id' in locationsList) { - const locationId = locationsList.id; - return locationId.substring(locationId.lastIndexOf('/') + 1); + if ("id" in locationsList) { + const locationId = locationsList.id; + return locationId.substring(locationId.lastIndexOf("/") + 1); } return undefined; -} +}; const getFetchPricesPathForRegion = (subscriptionId: string): string => { return `/subscriptions/${subscriptionId}/providers/Microsoft.CostManagement/fetchPrices`; @@ -223,9 +223,9 @@ export const getPriceMapAndCurrencyCode = async (map: OfferingIdMap): Promise x.type == "Consumption")?.unitPrice; + const unitPrice = item.prices.find((x) => x.type == "Consumption")?.unitPrice; regionPriceMap.set(skuName, unitPrice); } priceMap.set(region, regionPriceMap); @@ -265,10 +265,7 @@ export const getOfferingIds = async (regions: Array): Promise>; @@ -66,12 +66,12 @@ export type OfferingIdItem = { export type OfferingProperties = { offeringId: string; -} +}; export type OfferingIdRequest = { ids: Array; - location: string, -} + location: string; +}; export type OfferingIdMap = Map>;