database write on button click
How do I do it? I can't use trpc(can only make calls at top level), I could make an api endpoint, I tried, it's kind of awkward and looks like this:
I manage a ts type through
useState
. The user modifies that state
and at the end, I want to upload that state
to the database on the press of a button.4 Replies