Fix type errors and data service issues
- Corrected `useDataService.ts` useEffect hook return type. - Fixed `Index.tsx` type error related to `IndTransactionRecord`. - Addressed type incompatibility in `dataService.ts` for bill of materials. - Removed the attempted deletion of the non-existent `jobDataService.ts` file.
This commit is contained in:
@@ -27,7 +27,9 @@ export function useJobs() {
|
|||||||
setJobs(dataService.getJobs());
|
setJobs(dataService.getJobs());
|
||||||
});
|
});
|
||||||
|
|
||||||
return unsubscribe;
|
return () => {
|
||||||
|
unsubscribe();
|
||||||
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -62,7 +64,9 @@ export function useJob(jobId: string | null) {
|
|||||||
updateJob();
|
updateJob();
|
||||||
|
|
||||||
const unsubscribe = dataService.subscribe(updateJob);
|
const unsubscribe = dataService.subscribe(updateJob);
|
||||||
return unsubscribe;
|
return () => {
|
||||||
|
unsubscribe();
|
||||||
|
};
|
||||||
}, [jobId]);
|
}, [jobId]);
|
||||||
|
|
||||||
return job;
|
return job;
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { Plus, Factory, TrendingUp, Briefcase, FileText } from 'lucide-react';
|
import { Plus, Factory, TrendingUp, Briefcase, FileText } from 'lucide-react';
|
||||||
import { IndTransactionRecordNoId, IndJobRecordNoId, IndJobStatusOptions } from '@/lib/pbtypes';
|
import { IndTransactionRecordNoId, IndJobRecordNoId, IndJobStatusOptions, IndTransactionRecord } from '@/lib/pbtypes';
|
||||||
import { formatISK } from '@/utils/priceUtils';
|
import { formatISK } from '@/utils/priceUtils';
|
||||||
import JobCard from '@/components/JobCard';
|
import JobCard from '@/components/JobCard';
|
||||||
import JobForm from '@/components/JobForm';
|
import JobForm from '@/components/JobForm';
|
||||||
|
Reference in New Issue
Block a user