title: How to validate route parameter in Nuxt?
body: <p>I am trying to validate route parameter in my page component like this:</p>
  
  <pre><code>async validate({ params, store }) {
      await store.dispatch(types.VALIDATE_PARAMS_ASYNC, params.id)
  }
  </code></pre>
  
  <p>Then in store:</p>
  
  <pre><code>async [types.VALIDATE_PARAMS_ASYNC]({state, commit, dispatch}, payload) {
      try {
          const res = await this.$axios.$post('/api/params/validate', {
              params: payload
          })
          commit(types.MUTATE_SET_INFO, res.data) // this mutation is in another module. This doesn't work either
          return true
      } catch(e) {
          return false
      }
  }
  </code></pre>
  
  <p>This doesn't work at all. Even if I type invalid params, it still loads the page. Please help!</p>