Skip to content

Commit 902643a

Browse files
committed
set for version 2
1 parent 918d8e3 commit 902643a

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

client/src/App.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
filter: drop-shadow(0 0 2em #61dafbaa);
1313
}
1414

15-
/* Clean up default styling */
1615
body {
1716
min-height: 100vh;
1817
}

client/src/components/TransactionList.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function TransactionList({ transactions, onEdit, onDelete }: TransactionL
117117
</TableRow>
118118
) : (
119119
filteredTransactions.map((transaction) => (
120-
<TableRow key={transaction.id}>
120+
<TableRow key={transaction._id}>
121121
<TableCell>{format(transaction.date, 'MMM dd, yyyy')}</TableCell>
122122
<TableCell>
123123
<div className="flex items-center gap-2">
@@ -169,9 +169,8 @@ export function TransactionList({ transactions, onEdit, onDelete }: TransactionL
169169
<AlertDialogCancel>Cancel</AlertDialogCancel>
170170
<AlertDialogAction
171171
onClick={(e) => {
172-
e.preventDefault();
172+
//e.preventDefault();
173173

174-
// MongoID usually stored as _id in MongoDB documents from API
175174
const _id = transaction._id;
176175

177176
if (!_id) {

client/src/pages/Index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ function Dashboard() {
3737

3838
const handleEditTransaction = (data: TransactionFormData) => {
3939
if (selectedTransaction) {
40-
editTransaction(selectedTransaction.id, data);
40+
editTransaction(selectedTransaction._id, data);
4141
setSelectedTransaction(null);
4242
}
4343
};
4444

45-
const handleDeleteTransaction = (id: string) => {
46-
deleteTransaction(id);
45+
const handleDeleteTransaction = (_id: string) => {
46+
deleteTransaction(_id);
4747
};
4848

4949
const openEditDialog = (transaction: Transaction) => {

client/src/types/transaction.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ export type TransactionCategory =
1414
| 'salary'
1515
| 'freelance'
1616
| 'other';
17-
export interface Transaction {
18-
id?: string; // Make id optional if it might not always be present
19-
_id?: string; // Add _id for MongoDB responses
17+
export interface Transaction {
18+
_id: string;
2019
amount: number;
2120
description: string;
2221
date: Date;

0 commit comments

Comments
 (0)