mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 19:15:23 +02:00
fix: HistoryEntry.id type changed from number to string (Supabase returns UUID)
This commit is contained in:
@@ -8,7 +8,7 @@ import { cn } from '../lib/utils';
|
||||
interface HistoryViewProps {
|
||||
headers: string[];
|
||||
data: ExcelRow[];
|
||||
onRevert: (articleNo: string, oldData: ExcelRow, historyId?: number) => void;
|
||||
onRevert: (articleNo: string, oldData: ExcelRow, historyId?: string) => void;
|
||||
onEdit?: (rowIndex: number) => void;
|
||||
}
|
||||
|
||||
@@ -21,22 +21,18 @@ export function HistoryView({ headers, data, onRevert, onEdit }: HistoryViewProp
|
||||
const [isFullscreen, setIsFullscreen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[HistoryView] Mounting, data length:', data.length);
|
||||
loadHistory();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('[HistoryView] data changed, length:', data.length);
|
||||
if (data.length > 0) {
|
||||
loadHistory();
|
||||
}
|
||||
}, [data]);
|
||||
|
||||
const loadHistory = async () => {
|
||||
console.log('[HistoryView] loadHistory called');
|
||||
setLoading(true);
|
||||
const historyData = await getHistory();
|
||||
console.log('[HistoryView] getHistory returned:', historyData.length, 'entries', historyData[0]?.id === -1 || historyData[0]?.id === -2 ? '(ERROR)' : '');
|
||||
setHistory(historyData);
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user