feat: add transaction deduplication feature and enhance filtering options in settings and transactions pages
This commit is contained in:
@@ -89,6 +89,24 @@ export default function SettingsPage() {
|
||||
}
|
||||
};
|
||||
|
||||
const deduplicateTransactions = async () => {
|
||||
try {
|
||||
const response = await fetch(
|
||||
"/api/banking/transactions/deduplicate",
|
||||
{
|
||||
method: "POST",
|
||||
}
|
||||
);
|
||||
if (!response.ok) throw new Error("Erreur");
|
||||
const result = await response.json();
|
||||
refresh();
|
||||
return result;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const categorizedCount = data.transactions.filter((t) => t.categoryId).length;
|
||||
|
||||
return (
|
||||
@@ -114,6 +132,7 @@ export default function SettingsPage() {
|
||||
categorizedCount={categorizedCount}
|
||||
onClearCategories={clearAllCategories}
|
||||
onResetData={resetData}
|
||||
onDeduplicate={deduplicateTransactions}
|
||||
/>
|
||||
|
||||
<OFXInfoCard />
|
||||
|
||||
Reference in New Issue
Block a user