Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <[email protected]>
  • Loading branch information
derek-ho committed Jul 17, 2024
1 parent 9e0255a commit a62ea61
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions public/apps/configuration/panels/user-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 1 addition & 6 deletions public/apps/configuration/utils/internal-user-list-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ export async function getUserList(
return transformUserData(rawData.data);
}

export async function fetchUserNameList(
http: HttpStart,
dataSourceId: string
): Promise<string[]> {
export async function fetchUserNameList(http: HttpStart, dataSourceId: string): Promise<string[]> {
return Object.keys((await getUserListRaw(http, dataSourceId)).data);
}


16 changes: 8 additions & 8 deletions server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a62ea61

Please sign in to comment.