diff --git a/src/hooks/useDatabaseAccounts.tsx b/src/hooks/useDatabaseAccounts.tsx index 513266b50..97ced2799 100644 --- a/src/hooks/useDatabaseAccounts.tsx +++ b/src/hooks/useDatabaseAccounts.tsx @@ -26,7 +26,7 @@ export async function fetchDatabaseAccounts(subscriptionId: string, accessToken: nextLink = result.nextLink; accounts = [...accounts, ...result.value]; } - return accounts; + return accounts.sort((a, b) => a.name.localeCompare(b.name)); } export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined { diff --git a/src/hooks/useSubscriptions.tsx b/src/hooks/useSubscriptions.tsx index 954a2539b..d7ebfcbe3 100644 --- a/src/hooks/useSubscriptions.tsx +++ b/src/hooks/useSubscriptions.tsx @@ -1,5 +1,5 @@ -import { Subscription } from "../Contracts/DataModels"; import useSWR from "swr"; +import { Subscription } from "../Contracts/DataModels"; interface SubscriptionListResult { nextLink: string; @@ -28,7 +28,7 @@ export async function fetchSubscriptions(accessToken: string): Promise a.displayName.localeCompare(b.displayName)); } export function useSubscriptions(armToken: string): Subscription[] | undefined {