mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
feat(FE-137): refactor RecordingTable to remove unused types and streamline data fetching
This commit is contained in:
@@ -18,14 +18,7 @@ import RowDropdownOptions from '@/components/table/RowDropdownOptions';
|
|||||||
import RowCollapseOptions from '@/components/table/RowCollapseOptions';
|
import RowCollapseOptions from '@/components/table/RowCollapseOptions';
|
||||||
import { type CellContext } from '@tanstack/react-table';
|
import { type CellContext } from '@tanstack/react-table';
|
||||||
import { type Recording } from '@/types/api/production/recording';
|
import { type Recording } from '@/types/api/production/recording';
|
||||||
import { type ProjectFlock } from '@/types/api/production/project-flock';
|
|
||||||
import { RecordingApi } from '@/services/api/production';
|
import { RecordingApi } from '@/services/api/production';
|
||||||
import { type BaseApiResponse } from '@/types/api/api-general';
|
|
||||||
|
|
||||||
// Extended type that includes related data
|
|
||||||
type RecordingWithRelations = Recording & {
|
|
||||||
project_flock?: ProjectFlock;
|
|
||||||
};
|
|
||||||
|
|
||||||
const RowOptionsMenu = ({
|
const RowOptionsMenu = ({
|
||||||
type = 'dropdown',
|
type = 'dropdown',
|
||||||
@@ -98,11 +91,9 @@ const RecordingTable = () => {
|
|||||||
const bulkApproveModal = useModal();
|
const bulkApproveModal = useModal();
|
||||||
const bulkRejectModal = useModal();
|
const bulkRejectModal = useModal();
|
||||||
|
|
||||||
// Fetch recordings using SWR
|
|
||||||
const {
|
const {
|
||||||
data: recordings,
|
data: recordings,
|
||||||
isLoading,
|
isLoading,
|
||||||
mutate: refreshRecordings,
|
|
||||||
} = useSWR(
|
} = useSWR(
|
||||||
`${RecordingApi.basePath}?page=${page}&limit=${pageSize}`,
|
`${RecordingApi.basePath}?page=${page}&limit=${pageSize}`,
|
||||||
RecordingApi.getAllFetcher
|
RecordingApi.getAllFetcher
|
||||||
|
|||||||
Reference in New Issue
Block a user