The problem of vue fetching multiple data and merging

I"m distributing two fetch functions to get data in different places
and now I want to merge the two result data and put them into one table
, that is, is it possible for two action functions to finish mutation, together?
how do I write it

?
const actions = {

      getLatestJob(context){
         const result=api.getJobJson(context);
         result.then(function (res) {
        console.log("----------------------JSON QUERY NBU JOB:  res.status:"+res.status);
      if(res.status === 200){
        return res.json()
      }
    }).then(function (json) {

      console.log(typeof Array.from(json), Array.from(json));
      context.commit("setJson", json);
    })

      },

      getLatestJobFromShield(context){
         const result=api.getJobJsonFromShield(context);
         result.then(function (res) {
        console.log("----------------------JSON QUERY Shield JOB:  res.status:"+res.status);
      if(res.status === 200){
        return res.json()
      }
    }).then(function (json) {

      console.log(typeof Array.from(json), Array.from(json));
      //context.commit("setJson", json);
    })
      }

};

//mutation  
const mutations = {

    setJson(state,db){

then vue

 getJson(){

                this.$store.dispatch("getLatestJob");
                this.$store.dispatch("getLatestJobFromShield");

            },

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

The results calculated by the

methods are passed into a function in vuex, and the results can be calculated according to the two passing parameters in the function


solution 1: use Promise.all () , After waiting for both asynchronies to return results, merge
scenario 2: use async await < / A > Syntax Sugar performs asynchronous operations sequentially

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d2c1-2c37c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d2c1-2c37c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?