Finance-Tracker | Finance tracker is a web app | Stream Processing library
kandi X-RAY | Finance-Tracker Summary
kandi X-RAY | Finance-Tracker Summary
Finance tracker is a web app that analyses the transaction history of a bank account.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Finance-Tracker
Finance-Tracker Key Features
Finance-Tracker Examples and Code Snippets
Community Discussions
Trending Discussions on Finance-Tracker
QUESTION
I am currently writing a finance-tracker app and have built a data import from a CSV file that checks if an entry is already in the database, if not adds a certain category to an entry and then saves it to the database.
After importing a CSV file, I want to output as a response to the Post Request: The number of imported entries as well as all entries for which no suitable category was found. Unfortunately, I fail because of the asynchronous approach of Nestjs. However, my response is output before the other functions are done. So that the first import is always “imports: 0” and “unsortedTransactions: []. ”
How can I wait in the controller for all functions to complete before returning a response? TransactionController:
...ANSWER
Answered 2021-Feb-11 at 23:26You need to take advantage of async
/ await
functionality in js. You are returning promises from your service so this is easy.
Make the following changes
Add the async keyword to a function. (This allows you to await
other functions inside)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Finance-Tracker
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page