mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Alpha sort subscriptions and accounts in dropdown (#663)
This commit is contained in:
parent
d96cecdfe8
commit
e8033f0bbc
@ -26,7 +26,7 @@ export async function fetchDatabaseAccounts(subscriptionId: string, accessToken:
|
|||||||
nextLink = result.nextLink;
|
nextLink = result.nextLink;
|
||||||
accounts = [...accounts, ...result.value];
|
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 {
|
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Subscription } from "../Contracts/DataModels";
|
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
|
import { Subscription } from "../Contracts/DataModels";
|
||||||
|
|
||||||
interface SubscriptionListResult {
|
interface SubscriptionListResult {
|
||||||
nextLink: string;
|
nextLink: string;
|
||||||
@ -28,7 +28,7 @@ export async function fetchSubscriptions(accessToken: string): Promise<Subscript
|
|||||||
);
|
);
|
||||||
subscriptions = [...subscriptions, ...validSubscriptions];
|
subscriptions = [...subscriptions, ...validSubscriptions];
|
||||||
}
|
}
|
||||||
return subscriptions;
|
return subscriptions.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
||||||
|
Loading…
Reference in New Issue
Block a user