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());
|
||||
});
|
||||
|
||||
return unsubscribe;
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return {
|
||||
@@ -62,7 +64,9 @@ export function useJob(jobId: string | null) {
|
||||
updateJob();
|
||||
|
||||
const unsubscribe = dataService.subscribe(updateJob);
|
||||
return unsubscribe;
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
}, [jobId]);
|
||||
|
||||
return job;
|
||||
|
@@ -1,8 +1,9 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
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 JobCard from '@/components/JobCard';
|
||||
import JobForm from '@/components/JobForm';
|
||||
|
Reference in New Issue
Block a user