apply unique filter to getLocations api's (#17454)

* apply unique filter to getLocations api's

* filter resource locations to distinct list

* simplify location filter
This commit is contained in:
brian-harris
2021-10-22 16:00:07 -07:00
committed by GitHub
parent 6200a61382
commit 70f6eebc5a
2 changed files with 24 additions and 24 deletions

View File

@@ -38,11 +38,11 @@ export async function getLocations(account: azdata.Account, subscription: Subscr
if (response.errors.length > 0) {
throw new Error(response.errors.toString());
}
sortResourceArrayByName(response.locations);
const filteredLocations = response.locations.filter(loc => {
return sqlMigrationResourceLocations.includes(loc.displayName);
});
const filteredLocations = response.locations
.filter(loc => sqlMigrationResourceLocations.includes(loc.displayName));
sortResourceArrayByName(filteredLocations);
return filteredLocations;
}