Fix: Show organization popup in alphabetical order (#22259)

* Show organization popup in alphabetical order
* GetUserOrgList: Sort organizations by name in API

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Vikky Omkar
2020-04-06 16:57:11 +05:30
committed by GitHub
parent f91c7a81ce
commit 97184c1750
2 changed files with 24 additions and 3 deletions

View File

@@ -26,9 +26,7 @@ export class OrgSwitcher extends React.PureComponent<Props, State> {
getUserOrgs = async () => {
const orgs: UserOrgDTO[] = await getBackendSrv().get('/api/user/orgs');
this.setState({
orgs: orgs.sort((a, b) => a.orgId - b.orgId),
});
this.setState({ orgs });
};
setCurrentOrg = async (org: UserOrgDTO) => {