refactor(FE-114): simplify project flock types and update flock reference in recording

This commit is contained in:
rstubryan
2025-10-22 09:41:00 +07:00
parent 2e595b5e86
commit a904c35b7f
3 changed files with 15 additions and 106 deletions
@@ -22,90 +22,7 @@ const dummyRecordings: Recording[] = [
id: 1,
flock: {
id: 1,
period: 1,
flock: {
id: 1,
name: 'Flock A',
created_at: '2024-01-01',
updated_at: '2024-01-01',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin',
},
},
area: {
id: 1,
name: 'Area 1',
created_at: '2024-01-01',
updated_at: '2024-01-01',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin',
},
},
fcr: {
id: 1,
name: 'FCR 1.5',
created_at: '2024-01-01',
updated_at: '2024-01-01',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin',
},
},
location: {
id: 1,
name: 'Location 1',
address: 'Address 1',
area: {
id: 1,
name: 'Area 1',
},
created_at: '2024-01-01',
updated_at: '2024-01-01',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin',
},
},
kandangs: [
{
id: 1,
name: 'Kandang 1',
status: 'ACTIVE',
location: {
id: 1,
name: 'Location 1',
address: 'Address 1',
area: {
id: 1,
name: 'Area 1',
},
},
pic: {
id: 1,
id_user: 1,
email: 'pic@example.com',
name: 'PIC User',
},
created_at: '2024-01-01',
updated_at: '2024-01-01',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin',
},
},
],
name: 'Flock Recording 1',
created_at: '2024-01-01',
updated_at: '2024-01-01',
created_user: {
@@ -290,9 +207,7 @@ const RecordingTable = () => {
const paginatedData = useMemo(() => {
const filteredData = dummyRecordings.filter(
(recording) =>
recording.flock.flock.name
.toLowerCase()
.includes(search.toLowerCase()) ||
recording.flock.name.toLowerCase().includes(search.toLowerCase()) ||
recording.location.name.toLowerCase().includes(search.toLowerCase()) ||
recording.coop.name.toLowerCase().includes(search.toLowerCase())
);