#Horizon Banking App

5 messages · Page 1 of 1 (latest)

indigo mesa
#

I am having trouble displaying recent transactions as I keep getting the error: cannot read properties of undefined

Here are the links to the relevant files. I would appreciate anyone with some valuable insight, thanks.

Links:
TransactionsTable.tsx: https://hastebin.com/share/doteqecozo.javascript
bank.actions.ts: https://hastebin.com/share/fisinulipo.typescript

Here's the error messages: An error occurred while getting the account: TypeError: Cannot read properties of undefined (reading 'documents')
at $$ACTION_1 (webpack-internal:///(rsc)/./lib/actions/bank.actions.ts:91:63)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Home (webpack-internal:///(rsc)/./app/(root)/page.tsx:42:21)
GET /?id=665996b2003dfc4a1e96&_rsc=1x5f5 200 in 7379ms

AppwriteException [Error]: Invalid query: Attribute not found in schema: senderBankId

indigo mesa
#

Horizon Banking App

quaint rock
#

Check your transferTransactionData variable in the bank.actions.ts file line 83. That is undefined. So the value is not getting fetched.

log the value and check it before using the map function.

indigo mesa
#

Hi, thanks for sharing, after some troubleshooting it looks like the issue is coming from the lack of a corresponding senderBankId not being created in the database document. Here is my most cureent error, any thoughts?

#

"Error fetching transactions by bank ID: AppwriteException [Error]: Invalid query: Attribute not found in schema: senderBankId at Client.call (webpack-internal:///(rsc)/./node_modules/node-appwrite/lib/client.js:206:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Databases.listDocuments (webpack-internal:///(rsc)/./node_modules/node-appwrite/lib/services/databases.js:1658:16) at async $$ACTION_1 (webpack-internal:///(rsc)/./lib/actions/transaction.actions.ts:40:36) at async $$ACTION_1 (webpack-internal:///(rsc)/./lib/actions/bank.actions.ts:88:42) at async Home (webpack-internal:///(rsc)/./app/(root)/page.tsx:42:21) { code: 400, type: 'general_query_invalid', response: { message: 'Invalid query: Attribute not found in schema: senderBankId', code: 400, type: 'general_query_invalid', version: '1.5.7' } } An error occurred while getting the account: Error: Failed to fetch transactions by bank ID at $$ACTION_1 (webpack-internal:///(rsc)/./lib/actions/transaction.actions.ts:57:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async $$ACTION_1 (webpack-internal:///(rsc)/./lib/actions/bank.actions.ts:88:42) at async Home (webpack-internal:///(rsc)/./app/(root)/page.tsx:42:21)"