title: How to use Promise.all using Axios Async Await
body: <p>I have this Axios Async Await code in Nuxt.js, I am not sure on how and where to put the <code>Promise.all</code> here. I am trying to promise the <code>getThemes()</code> and <code>getData()</code>. Could somebody help me with the <code>Promise.all</code> code?</p>
  
  <p>And do I have to put the <code>Promise.all</code> in the <code>mounted()</code>?</p>
  
  <pre><code>mounted() {
      this.getData(this.$route.params.id);
      this.getThemes();
    },
  
    methods: {
      async getThemes() {
        this.loading = true;
        await axios.get(`${process.env.API_URL}/v1/communication/email-themes`, {}).then((response) =&gt; {
          this.theme = response.data.data;
          this.selected = this.theme.filter(t =&gt; this.themeId === t.id)[0].id;
          this.loading = false;
        }).catch((error) =&gt; {
          this.loading = false;
          this.errormsg = error.response.data.message;
        });
      },
  
      async getData(id) {
        this.loading = true;
        await axios
          .get(`${process.env.API_URL}/v1/communication/email-templates/${id}`)
          .then(({
            data
          }) =&gt; {
            this.templateName = data.data.name;
            this.templateCode = data.data.content;
            this.themeId = data.data.theme_id;
            this.loading = false;
          }).catch((error) =&gt; {
            this.loading = false;
            this.errormsg = error.response.data.message;
          });
      },
  
      async patchData(id) {
        await axios.put(`${process.env.API_URL}/v1/communication/email-templates/${this.$route.params.id}`, {
          name: this.templateName,
          content: this.templateCode,
          theme_id: this.selected
        }).then((response) =&gt; {
          this.results = response.data;
          this.loading = false;
        }).catch((error) =&gt; {
          this.loading = false;
          this.errormsg = error.response.data.message;
        });
      }
    }
  </code></pre>