I’m working on my PERN app. I’ve already deployed it to Heroku and everything looks normal in my app, people can choose the product and buy it. When the transaction is completed the column STATUS in my orders table updates to PAID. However, how do I know when the table or the row updates to PAID.
I was thinking to fetch every minute from my react app to the server and PostgreSQL. So I can see changes in my orders table. But I think is not a good idea.
I was reading about pg_notify and triggers in PostgreSQL documentation. However, I did not understand very well.
Do you know one approach to this problem or any other resource which can explain it in another manner?