web/admin: fix source selection for identification stage (#13007)
closes #12995 Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
		| @ -27,13 +27,13 @@ export function sourcesSelector(instanceSources: string[] | undefined) { | ||||
|     return async () => { | ||||
|         const sourcesApi = new SourcesApi(DEFAULT_CONFIG); | ||||
|         const sources = await Promise.allSettled( | ||||
|             instanceSources.map((instanceId) => | ||||
|                 sourcesApi.sourcesAllRetrieve({ slug: instanceId }), | ||||
|             ), | ||||
|             instanceSources.map((instanceId) => sourcesApi.sourcesAllList({ pbmUuid: instanceId })), | ||||
|         ); | ||||
|         return sources | ||||
|             .filter((s) => s.status === "fulfilled") | ||||
|             .map((s) => s.value) | ||||
|             .filter((s) => s.pagination.count > 0) | ||||
|             .map((s) => s.results[0]) | ||||
|             .map(sourceToSelect); | ||||
|     }; | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Jens L.
					Jens L.