Wait after server action

I want to create a server action like this:

  1. API action
  2. (wait untill API action has completed)
  3. Insert API data into database

Step 1 and 3 is no big deal, but I’m not sure how I can make the insert step “wait” untill the API action is completed. Now the insert runs faster then the API action has gathered data, so it won’t insert any data at all.

Community Page
Last updated: