Prevent concurrent api pulls on page refresh

I’m learning REST api along with the MEVN stack and am looking for some guidance on how to improve my code when it comes to interfering with pulling information from an external api and pushing it to my mongo database. The problem is that the process of pulling information from a different api and saving it to my own database takes so long (I am rate limited pulling from the external api) such that if a user were to refresh the page, it can either break the process or send another identical request – both of which cause issues down the line.

Is there a way I can isolate the “read from external api & write to own database” process from user interactions/page reload once a request gets sent through? I’ve been trying to kiddy-proof the code to basically have a request pick up where it left off if a user were to reload the page, however I’m wondering if there’s a more robust method, such that on page reload, is more-so:

Hey man, I see you’ve sent in an identical request for information I’m already working on. How about I dismiss that request and keep working on the current one to reduce headache?

Code below is of basic architecture. The server code block is simplified and a lot of the kiddy-proofing logic is omitted for clarity.

// Codeblock on frontend to send request to server.
<script>

// template method that sends initial request.
async lookup() {
  const url = `http://localhost:5000/api/name/${this.$route.params.region}/${this.$route.params.username}`
  try {
    const res = await axios.get(url)
    this.nameInfo= res.data.shift()
    this.userReadyRender = true
  } catch (err) {
      console.log(err)
    }
</script>
<template>
// template things
</template>
// server.js on localhost:5000

const router = express.Router()

router.route('/:region/:name')
  .get(async (req, res) => {

    // Connect to mongodb
    await connectToMongo()

    // Check if the name exists in external api database
    const user = await checkExistence(req.params.name, req.params.region)

    if (user) {
      // Do multiple things:
      // 1) Insert new collection into database named `req.params.name`
      // 2) Pull information X from external api which is an array ranging from 50-800 elements
      // 3) Iterate through every X[i] which returns an object Y
      // 4) Push each object Y to a newly created document in the collection created in step 1

      // collection variable below is the collection in step 1
      res.send(collection)
    }
  })