diff --git a/public/apps/configuration/panels/role-mapping/role-edit-mapped-user.tsx b/public/apps/configuration/panels/role-mapping/role-edit-mapped-user.tsx index 6a705a55..d00faf3c 100644 --- a/public/apps/configuration/panels/role-mapping/role-edit-mapped-user.tsx +++ b/public/apps/configuration/panels/role-mapping/role-edit-mapped-user.tsx @@ -91,9 +91,7 @@ export function RoleEditMappedUser(props: RoleEditMappedUserProps) { React.useEffect(() => { const fetchInternalUserNames = async () => { try { - setUserNames( - await fetchUserNameList(props.coreStart.http, dataSource.id) - ); + setUserNames(await fetchUserNameList(props.coreStart.http, dataSource.id)); } catch (e) { addToast(createUnknownErrorToast('fetchInternalUserNames', 'load data')); console.error(e); diff --git a/public/apps/configuration/panels/user-list.tsx b/public/apps/configuration/panels/user-list.tsx index 089e3e79..f9388fb5 100644 --- a/public/apps/configuration/panels/user-list.tsx +++ b/public/apps/configuration/panels/user-list.tsx @@ -114,10 +114,7 @@ export function UserList(props: AppDependencies) { const fetchData = async () => { try { setLoading(true); - const userDataPromise = getUserList( - props.coreStart.http, - dataSource.id - ); + const userDataPromise = getUserList(props.coreStart.http, dataSource.id); setCurrentUsername((await getAuthInfo(props.coreStart.http)).user_name); setUserData(await userDataPromise); setErrorFlag(false); diff --git a/public/apps/configuration/utils/internal-user-list-utils.tsx b/public/apps/configuration/utils/internal-user-list-utils.tsx index e6358859..bc907dfc 100644 --- a/public/apps/configuration/utils/internal-user-list-utils.tsx +++ b/public/apps/configuration/utils/internal-user-list-utils.tsx @@ -58,11 +58,6 @@ export async function getUserList( return transformUserData(rawData.data); } -export async function fetchUserNameList( - http: HttpStart, - dataSourceId: string -): Promise { +export async function fetchUserNameList(http: HttpStart, dataSourceId: string): Promise { return Object.keys((await getUserListRaw(http, dataSourceId)).data); } - - diff --git a/server/routes/index.ts b/server/routes/index.ts index ed317f28..270d05f7 100644 --- a/server/routes/index.ts +++ b/server/routes/index.ts @@ -253,14 +253,14 @@ export function defineRoutes(router: IRouter, dataSourceEnabled: boolean) { const client = context.security_plugin.esClient.asScoped(request); let esResp; try { - esResp = await wrapRouteWithDataSource( - dataSourceEnabled, - context, - request, - 'opensearch_security.listResource', - { resourceName: request.params.resourceName } - ); - + esResp = await wrapRouteWithDataSource( + dataSourceEnabled, + context, + request, + 'opensearch_security.listResource', + { resourceName: request.params.resourceName } + ); + return response.ok({ body: { total: Object.keys(esResp).length,