Skip to content

Commit

Permalink
refactor: Change lib v2 code to TS
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Jun 23, 2024
1 parent 49b7142 commit 5c6ac20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ import { useQuery } from '@tanstack/react-query';

import { getStudioHomeLibrariesV2 } from './api';


interface CustomParams {
type?: string,
page?: number,
pageSize?: number,
pagination?: boolean,
}

/**
* Builds the query to fetch list of V2 Libraries
*/
const useListStudioHomeV2Libraries = (customParams) => (
const useListStudioHomeV2Libraries = (customParams: CustomParams) => (
useQuery({
queryKey: ['listV2Libraries', customParams],
queryFn: () => getStudioHomeLibrariesV2(customParams),
Expand Down
2 changes: 1 addition & 1 deletion src/studio-home/tabs-section/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useNavigate, useLocation } from 'react-router-dom';
import { getLoadingStatuses, getStudioHomeData } from '../data/selectors';
import messages from './messages';
import LibrariesTab from './libraries-tab';
import LibrariesV2Tab from './libraries-v2-tab/index';
import LibrariesV2Tab from './libraries-v2-tab/index.tsx';

Check failure on line 12 in src/studio-home/tabs-section/index.jsx

View workflow job for this annotation

GitHub Actions / tests

Unexpected use of file extension "tsx" for "./libraries-v2-tab/index.tsx"
import ArchivedTab from './archived-tab';
import CoursesTab from './courses-tab';
import { RequestStatus } from '../../data/constants';
Expand Down

0 comments on commit 5c6ac20

Please sign in to comment.