Fix save changes looping issue and authorize all Supabase API calls

This commit is contained in:
Christian Vidal Wolf
2026-04-10 12:03:12 +02:00
parent a92e136372
commit ee73b85100
3 changed files with 57 additions and 34 deletions
+3 -2
View File
@@ -8,9 +8,10 @@ interface HistoryViewProps {
headers: string[];
data: ExcelRow[];
onRevert: (articleNo: string, oldData: ExcelRow, historyId?: number) => void;
sessionToken?: string;
}
export function HistoryView({ headers, data, onRevert }: HistoryViewProps) {
export function HistoryView({ headers, data, onRevert, sessionToken }: HistoryViewProps) {
const [history, setHistory] = useState<HistoryEntry[]>([]);
const [loading, setLoading] = useState(true);
const [expandedId, setExpandedId] = useState<string | null>(null);
@@ -22,7 +23,7 @@ export function HistoryView({ headers, data, onRevert }: HistoryViewProps) {
const loadHistory = async () => {
setLoading(true);
const data = await getHistory();
const data = await getHistory(sessionToken);
setHistory(data);
setLoading(false);
};