Skip to content

Commit 2f759e5

Browse files
committed
fix: solve lint issues
1 parent 2a52e40 commit 2f759e5

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/authz-module/data/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export const getOrgs = async (search?: string, page?: number, pageSize?: number)
220220
export const getScopes = async (params: GetScopesParams): Promise<GetScopesResponse> => {
221221
const url = new URL(getApiUrl('/api/authz/v1/scopes/'));
222222
if (params.search) { url.searchParams.set('search', params.search); }
223+
if (params.scopeType) { url.searchParams.set('scope_type', params.scopeType); }
223224
if (params.org) { url.searchParams.set('org', params.org); }
224225
if (params.managementPermissionOnly) { url.searchParams.set('management_permission_only', 'true'); }
225226
url.searchParams.set('page', (params.page ?? 1).toString());

src/authz-module/data/hooks.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,19 +561,19 @@ describe('useOrgs', () => {
561561
jest.clearAllMocks();
562562
});
563563

564-
const mockOrgs = [{
564+
const mockOrgsResult = [{
565565
id: 1, name: 'Org One', shortName: 'org1', description: '', logo: null, active: true,
566566
}];
567567

568568
it('returns organizations on success', async () => {
569569
getAuthenticatedHttpClient.mockReturnValue({
570-
get: jest.fn().mockResolvedValue({ data: { results: mockOrgs } }),
570+
get: jest.fn().mockResolvedValue({ data: { results: mockOrgsResult } }),
571571
});
572572

573573
const { result } = renderHook(() => useOrgs(), { wrapper: createWrapper() });
574574

575575
await waitFor(() => expect(result.current.isSuccess).toBe(true));
576-
expect(result.current.data?.results).toEqual(mockOrgs);
576+
expect(result.current.data?.results).toEqual(mockOrgsResult);
577577
});
578578

579579
it('handles error when API fails', async () => {

src/authz-module/hooks/useQuerySettings.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { renderHook, act } from '@testing-library/react';
2-
import { QuerySettings } from '@src/authz-module/data/types';
2+
import { QuerySettings } from '@src/authz-module/data/api';
33
import { useQuerySettings } from './useQuerySettings';
44

55
describe('useQuerySettings', () => {

src/authz-module/hooks/useQuerySettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useCallback, useState } from 'react';
2-
import { QuerySettings } from '@src/authz-module/data/types';
2+
import { QuerySettings } from '@src/authz-module/data/api';
33

44
interface DataTableFilters {
55
pageSize: number;

src/authz-module/role-assignation-wizard/components/ScopeList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useRef, useState } from 'react';
2-
import { Form, Icon, Spinner } from '@openedx/paragon';
2+
import { Icon, Spinner } from '@openedx/paragon';
33
import { ExpandLess, ExpandMore } from '@openedx/paragon/icons';
44
import { Org, Scope } from 'types';
55

0 commit comments

Comments
 (0)