refactor: standardize quotation marks in pnpm-lock.yaml and improve code formatting across various components; enhance readability and maintain consistency in code style
This commit is contained in:
@@ -134,7 +134,11 @@ export default function AccountsPage() {
|
||||
|
||||
// Convert accountsWithStats to regular accounts for compatibility
|
||||
const accounts = accountsWithStats.map(
|
||||
({ transactionCount: _transactionCount, calculatedBalance: _calculatedBalance, ...account }) => account,
|
||||
({
|
||||
transactionCount: _transactionCount,
|
||||
calculatedBalance: _calculatedBalance,
|
||||
...account
|
||||
}) => account,
|
||||
);
|
||||
|
||||
const formatCurrency = (amount: number) => {
|
||||
@@ -165,10 +169,11 @@ export default function AccountsPage() {
|
||||
// Calculer le balance à partir du solde total et du solde initial
|
||||
// balance = totalBalance - initialBalance
|
||||
const balance = formData.totalBalance - formData.initialBalance;
|
||||
|
||||
|
||||
// Convertir "folder-root" en null
|
||||
const folderId = formData.folderId === "folder-root" ? null : formData.folderId;
|
||||
|
||||
const folderId =
|
||||
formData.folderId === "folder-root" ? null : formData.folderId;
|
||||
|
||||
const updatedAccount = {
|
||||
...editingAccount,
|
||||
name: formData.name,
|
||||
@@ -325,10 +330,10 @@ export default function AccountsPage() {
|
||||
|
||||
const result = await response.json();
|
||||
invalidateAllAccountQueries(queryClient);
|
||||
|
||||
|
||||
// Réinitialiser la sélection
|
||||
setSelectedAccounts(new Set());
|
||||
|
||||
|
||||
// Afficher un message de succès
|
||||
alert(
|
||||
`Fusion réussie ! ${result.transactionCount} transactions déplacées vers le compte de destination.`,
|
||||
@@ -384,7 +389,16 @@ export default function AccountsPage() {
|
||||
// Update cache directly
|
||||
queryClient.setQueryData(
|
||||
["accounts-with-stats"],
|
||||
(old: Array<Account & { transactionCount: number; calculatedBalance: number }> | undefined) => {
|
||||
(
|
||||
old:
|
||||
| Array<
|
||||
Account & {
|
||||
transactionCount: number;
|
||||
calculatedBalance: number;
|
||||
}
|
||||
>
|
||||
| undefined,
|
||||
) => {
|
||||
if (!old) return old;
|
||||
return old.map((a) => (a.id === accountId ? updatedAccount : a));
|
||||
},
|
||||
@@ -564,25 +578,27 @@ export default function AccountsPage() {
|
||||
(f: FolderType) => f.id === account.folderId,
|
||||
);
|
||||
|
||||
const accountWithStats = accountsWithStats.find(
|
||||
(a) => a.id === account.id,
|
||||
);
|
||||
return (
|
||||
<AccountCard
|
||||
key={account.id}
|
||||
account={account}
|
||||
folder={folder}
|
||||
transactionCount={getTransactionCount(account.id)}
|
||||
calculatedBalance={accountWithStats?.calculatedBalance}
|
||||
onEdit={handleEdit}
|
||||
onDelete={handleDelete}
|
||||
formatCurrency={formatCurrency}
|
||||
isSelected={selectedAccounts.has(account.id)}
|
||||
onSelect={toggleSelectAccount}
|
||||
draggableId={`account-${account.id}`}
|
||||
compact={isCompactView}
|
||||
/>
|
||||
);
|
||||
const accountWithStats = accountsWithStats.find(
|
||||
(a) => a.id === account.id,
|
||||
);
|
||||
return (
|
||||
<AccountCard
|
||||
key={account.id}
|
||||
account={account}
|
||||
folder={folder}
|
||||
transactionCount={getTransactionCount(account.id)}
|
||||
calculatedBalance={
|
||||
accountWithStats?.calculatedBalance
|
||||
}
|
||||
onEdit={handleEdit}
|
||||
onDelete={handleDelete}
|
||||
formatCurrency={formatCurrency}
|
||||
isSelected={selectedAccounts.has(account.id)}
|
||||
onSelect={toggleSelectAccount}
|
||||
draggableId={`account-${account.id}`}
|
||||
compact={isCompactView}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</FolderDropZone>
|
||||
@@ -694,7 +710,9 @@ export default function AccountsPage() {
|
||||
account={account}
|
||||
folder={accountFolder}
|
||||
transactionCount={getTransactionCount(account.id)}
|
||||
calculatedBalance={accountWithStats?.calculatedBalance}
|
||||
calculatedBalance={
|
||||
accountWithStats?.calculatedBalance
|
||||
}
|
||||
onEdit={handleEdit}
|
||||
onDelete={handleDelete}
|
||||
formatCurrency={formatCurrency}
|
||||
|
||||
Reference in New Issue
Block a user