title: How to fix the error of unknown mutation type in Vuex?
body: <p>I have googled this error however the answers I get, didn't help me. I am trying to make a like-dislike count with using Vuex. I am using jsonplaceholder for data. Here I take my data and setting a like attribute for all the objects.</p>
  <pre class="lang-js prettyprint-override"><code>actions: {
  async fetchPhotos({commit}) {
        const response = await axios.get('https://jsonplaceholder.typicode.com/photos');
        commit('setPhotos', response.data.splice(0,100))
      },
  }
  
  mutations: {
  setPhotos: (state, photos) =&gt; {
        (state.albumList = photos);
        state.albumList.forEach(element =&gt; element.likes = 0)}
  }
  </code></pre>
  <p>After in my dom I want to use one button for dislike and other for like. I want to display the like counter when I click the buttons.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div v-for=&quot;photos in allPhotos&quot; :key=&quot;photos.id&quot;&gt;
          &lt;div class=&quot;card&quot; @click=&quot;detail(photos)&quot;&gt;&lt;img :src=&quot;photos.thumbnailUrl&quot; alt=&quot;&quot;&gt;&lt;/div&gt;
          &lt;div class=&quot;likes&quot;&gt;
            &lt;div class=&quot;myButton&quot; &gt;&lt;button class=&quot;red&quot; @click=&quot;minus(photos.id)&quot;&gt;&lt;i class=&quot;fas fa-minus&quot;&gt;&lt;/i&gt;&lt;/button&gt;&lt;/div&gt;
            &lt;div&gt;{{photos.likes}}&lt;/div&gt;
            &lt;div class=&quot;myButton &quot;&gt;&lt;button class=&quot;green&quot; @click=&quot;plus(photos.id)&quot;&gt;&lt;i class=&quot;fas fa-plus&quot;&gt;&lt;/i&gt;&lt;/button&gt;&lt;/div&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>So I added minus mutations in my store and in my script.</p>
  <pre><code>methods: {
      ...mapMutations(['minus']),
  </code></pre>
  <pre><code>state: {
      albumList : [],
    },
  
  mutations: {
      minus: (state, id) =&gt; {
        state.albumList[id-1].likes--
     },
  </code></pre>
  <p>After all this, I am having an error:</p>
  <blockquote>
  <p>[vuex] unknown mutation type: minus.</p>
  </blockquote>
  <p>I can't see what I am doing wrong here.</p>
  <p>PS:I also trimmed the code for it to be clearer.</p>