{"push_id":1608433650,"size":6,"distinct_size":6,"ref":"refs/heads/master","head":"0c3d58fd0e53d2e9d92ad6f18a9120655b8d5e10","before":"4856c7cc5b1aa4aaa5bb95a9fb71094dfc6768d7","commits":[{"sha":"b15a7d834634bd1c2dc627026a14418fd081e0fb","author":{"name":"ahyahya","email":"ae35fbc40929f93c8be2d14253c84d0a300a7de7@gmail.com"},"message":"[from now] 2017/03/12 00:19:15\n\ndiff --git a/apis/todo-list-overview.js b/apis/todo-list-overview.js\nindex 3e2807e..ad8eb5f 100644\n--- a/apis/todo-list-overview.js\n+++ b/apis/todo-list-overview.js\n@@ -11,6 +11,7 @@ module.exports = (TodoList, Todo) =>\n         const lid = todoList._id;\n         const todos = await Todo.find({lid});\n         return {\n+          lid: todoList._id,\n           name: todoList.name,\n           todos\n         };\n@@ -18,9 +19,8 @@ module.exports = (TodoList, Todo) =>\n       // console.log(lists);\n       const result = lists.map((list) => {\n         // console.log('list:', list);\n-        const name = list.name;\n-        const count = list.todos.length;\n-        const data = { name, count };\n+        const { lid, name, count } = list;\n+        const data = { lid, name, count };\n         if (count === 0) {\n           data.hasChild = false;\n           data.latestUpdate = Number.POSITIVE_INFINITY;\ndiff --git a/components/list-overview.vue b/components/list-overview.vue\nindex 52c0976..7772d69 100644\n--- a/components/list-overview.vue\n+++ b/components/list-overview.vue\n@@ -1,5 +1,6 @@\n <template>\n-  <nuxt-link tag=\"section\" to=\"/test\" class=\"list-overview\">\n+  <nuxt-link tag=\"section\" :to=\"`/list/${this.lid}`\" class=\"list-overview\">\n+    lid: {{lid}}\n     <div class=\"list-name\">{{name}}</div>\n     <div class=\"list-count\">{{count}}</div>\n     <div class=\"list-check-count\">{{checkCount}}</div>\n@@ -16,6 +17,10 @@\n <script>\n export default {\n   props: {\n+    lid: {\n+      type: Number,\n+      required: true\n+    },\n     name: {\n       type: String,\n       required: true\ndiff --git a/components/todo-detail.vue b/components/todo-detail.vue\nindex c3eb1d4..0679afc 100644\n--- a/components/todo-detail.vue\n+++ b/components/todo-detail.vue\n@@ -23,12 +23,12 @@ export default {\n       required: true\n     },\n     deadline: {\n-      type: String,\n+      type: Date,\n       required: false,\n       default: _ => ''\n     },\n     createdAt: {\n-      type: String,\n+      type: Date,\n       required: true\n     },\n     completed: {\ndiff --git a/layouts/error.vue b/layouts/error.vue\nindex dca9d24..354c1fb 100644\n--- a/layouts/error.vue\n+++ b/layouts/error.vue\n@@ -15,7 +15,7 @@\n <script>\n export default {\n   props: ['error']\n-}\n+};\n </script>\n\n <style scoped>\ndiff --git a/package.json b/package.json\nindex 71bb326..793ef52 100644\n--- a/package.json\n+++ b/package.json\n@@ -5,7 +5,7 @@\n   \"author\": \"ahyahya <mrfool38@gmail.com>\",\n   \"private\": true,\n   \"scripts\": {\n-    \"dev\": \"nodemon -w app.js -w nuxt.config.js -w apis app.js\",\n+    \"dev\": \"nodemon -w app.js -w nuxt.config.js -w apis -w store -w config app.js\",\n     \"build\": \"nuxt build\",\n     \"start\": \"cross-env NODE_ENV=production node app.js\",\n     \"precommit\": \"npm run lint\",\n@@ -23,7 +23,8 @@\n     \"mongoose\": \"^4.8.6\",\n     \"mongoose-auto-increment\": \"^5.0.1\",\n     \"nuxt\": \"latest\",\n-    \"superagent\": \"^3.5.0\"\n+    \"superagent\": \"^3.5.0\",\n+    \"validate.js\": \"^0.11.1\"\n   },\n   \"devDependencies\": {\n     \"babel-eslint\": \"^7.1.1\",\ndiff --git a/pages/index.vue b/pages/index.vue\nindex c9178b7..a11f0f4 100644\n--- a/pages/index.vue\n+++ b/pages/index.vue\n@@ -8,6 +8,7 @@\n     <div>{{JSON.stringify($store.state['todo-lists'].lists)}}</div>\n     <list-overview\n       v-for=\"list in $store.state['todo-lists'].lists\"\n+      :lid=\"list.lid\"\n       :name=\"list.name\"\n       :count=\"list.count\"\n       :checkCount=\"list.checkCount\"\n@@ -22,6 +23,8 @@\n <script>\n import ListOverview from '~components/list-overview.vue';\n import axios from 'axios';\n+import validation from '~assets/js/api-validation.js';\n+\n export default {\n   components: { ListOverview },\n   computed: {\n@@ -29,23 +32,26 @@ export default {\n       return this.$store.state['todo-lists'].lists;\n     }\n   },\n-  data: ({store}) => {\n-    // console.log(store.state['todo-lists'].lists);\n-    return {\n-      name: ''\n-    };\n-  },\n+  data: ({store}) => ({ name: '' }),\n   async fetch({ store, params }) {\n     const {data} = await axios.get('http://localhost:3000/api/todo-list-overview');\n     store.commit('todo-lists/update', data);\n   },\n   methods: {\n     async createList(evt) {\n-      this.$store.commit('todo-lists/add', {\n-        name: this.name,\n-        hasChild: false\n-      });\n-      console.log(await axios.post('http://localhost:3000/api/todo-lists', { name: this.name }));\n+      const sendData = { name: this.name };\n+      let err = validation(sendData, 'TodoList');\n+      if (!err) {\n+        try {\n+          let {data} = await axios.post('http://localhost:3000/api/todo-lists', sendData);\n+          data = Object.assign({\n+            count: 0,\n+            hasChild: false\n+          }, data);\n+          this.$store.commit('todo-lists/add', data);\n+        } catch (e) { err = e; }\n+      }\n+      if (err) console.log('err:', err);\n     }\n   }\n };\ndiff --git a/pages/list.vue b/pages/list.vue\ndeleted file mode 100644\nindex 3895608..0000000\n--- a/pages/list.vue\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-<template>\n-  <main>\n-    <div class=\"create-todo\">\n-      <div class=\"create-todo-left\">\n-        <input type=\"text\" placeholder=\"ToDo名\" v-model=\"name\">\n-        <input type=\"text\" placeholder=\"期限\" v-model=\"deadline\">\n-      </div>\n-      <div class=\"create-todo-right\">\n-        <button @click=\"createTodo\">ついか</button>\n-      </div>\n-      <todo-detail\n-        v-for=\"todo in todos\"\n-        :name=\"todo.name\"\n-        :deadline=\"todo.deadline\"\n-        :createdAt=\"todo.createdAt\"\n-        :completed=\"todo.completed\"></todo-detail>\n-    </div>\n-  </main>\n-</template>\n-\n-<script>\n-import TodoDetail from '~components/todo-detail';\n-export default {\n-  components: { TodoDetail },\n-  data: _ => ({\n-    name: '',\n-    deadline: '',\n-    todos: [\n-      { name: 'testTODO', deadline: 'test deadline', createdAt: new Date().toString(), completed: false },\n-      { name: 'testTODO2', deadline: 'test deadline', createdAt: new Date().toString(), completed: true }\n-    ]\n-  }),\n-  methods: {\n-    createTodo(e) {\n-      this.todos.push({\n-        name: this.name,\n-        deadline: this.deadline,\n-        createdAt: new Date().toString(),\n-        completed: false\n-      });\n-      console.log(this.name, this.deadline);\n-    }\n-  }\n-};\n-</script>","distinct":true,"url":"https://api.github.com/repos/ahyahya/local-task-app/commits/b15a7d834634bd1c2dc627026a14418fd081e0fb"},{"sha":"63ac5dac0eaa40173c056f5b320b84a681cda584","author":{"name":"ahyahya","email":"ae35fbc40929f93c8be2d14253c84d0a300a7de7@gmail.com"},"message":"[from now] 2017/03/12 10:29:53\n\ndiff --git a/apis/todo-list-overview.js b/apis/todo-list-overview.js\nindex ad8eb5f..a235e51 100644\n--- a/apis/todo-list-overview.js\n+++ b/apis/todo-list-overview.js\n@@ -19,7 +19,8 @@ module.exports = (TodoList, Todo) =>\n       // console.log(lists);\n       const result = lists.map((list) => {\n         // console.log('list:', list);\n-        const { lid, name, count } = list;\n+        const { lid, name } = list;\n+        const count = list.todos.length;\n         const data = { lid, name, count };\n         if (count === 0) {\n           data.hasChild = false;\ndiff --git a/components/list-overview.vue b/components/list-overview.vue\nindex 7772d69..260dd89 100644\n--- a/components/list-overview.vue\n+++ b/components/list-overview.vue\n@@ -1,10 +1,16 @@\n <template>\n   <nuxt-link tag=\"section\" :to=\"`/list/${this.lid}`\" class=\"list-overview\">\n-    lid: {{lid}}\n-    <div class=\"list-name\">{{name}}</div>\n-    <div class=\"list-count\">{{count}}</div>\n-    <div class=\"list-check-count\">{{checkCount}}</div>\n-    <div class=\"list-deadline\">{{deadline}}</div>\n+    <div class=\"has-child\" v-if=\"hasChild\">\n+      lid: {{lid}}\n+      <div class=\"list-name\">{{name}}</div>\n+      <div class=\"list-count\">{{count}}</div>\n+      <div class=\"list-check-count\">{{checkCount}}</div>\n+      <div class=\"list-deadline\">{{deadline}}</div>\n+    </div>\n+    <div class=\"has-no-child\" v-else>\n+      lid: {{lid}}\n+      <div class=\"list-name\">{{name}}</div>\n+    </div>\n   </nuxt-link>\n </template>\n\n@@ -17,6 +23,10 @@\n <script>\n export default {\n   props: {\n+    hasChild: {\n+      type: Boolean,\n+      required: true\n+    },\n     lid: {\n       type: Number,\n       required: true","distinct":true,"url":"https://api.github.com/repos/ahyahya/local-task-app/commits/63ac5dac0eaa40173c056f5b320b84a681cda584"},{"sha":"cf7e73d1755f36e3226456f73fc6336faad07813","author":{"name":"ahyahya","email":"ae35fbc40929f93c8be2d14253c84d0a300a7de7@gmail.com"},"message":"[from now] 2017/03/12 12:12:53\n\ndiff --git a/apis/todo-list-overview.js b/apis/todo-list-overview.js\nindex a235e51..9e5eb5e 100644\n--- a/apis/todo-list-overview.js\n+++ b/apis/todo-list-overview.js\n@@ -21,7 +21,7 @@ module.exports = (TodoList, Todo) =>\n         // console.log('list:', list);\n         const { lid, name } = list;\n         const count = list.todos.length;\n-        const data = { lid, name, count };\n+        const data = { _id: lid, name, count };\n         if (count === 0) {\n           data.hasChild = false;\n           data.latestUpdate = Number.POSITIVE_INFINITY;\ndiff --git a/pages/index.vue b/pages/index.vue\nindex a11f0f4..9e8f918 100644\n--- a/pages/index.vue\n+++ b/pages/index.vue\n@@ -8,10 +8,11 @@\n     <div>{{JSON.stringify($store.state['todo-lists'].lists)}}</div>\n     <list-overview\n       v-for=\"list in $store.state['todo-lists'].lists\"\n-      :lid=\"list.lid\"\n+      :lid=\"list._id\"\n       :name=\"list.name\"\n       :count=\"list.count\"\n       :checkCount=\"list.checkCount\"\n+      :hasChild=\"list.hasChild\"\n       :deadline=\"list.deadline\"></list-overview>\n   </main>\n </template>\n@@ -33,9 +34,8 @@ export default {\n     }\n   },\n   data: ({store}) => ({ name: '' }),\n-  async fetch({ store, params }) {\n-    const {data} = await axios.get('http://localhost:3000/api/todo-list-overview');\n-    store.commit('todo-lists/update', data);\n+  async fetch({store}) {\n+    await store.dispatch('todo-lists/initialize');\n   },\n   methods: {\n     async createList(evt) {\n@@ -43,12 +43,7 @@ export default {\n       let err = validation(sendData, 'TodoList');\n       if (!err) {\n         try {\n-          let {data} = await axios.post('http://localhost:3000/api/todo-lists', sendData);\n-          data = Object.assign({\n-            count: 0,\n-            hasChild: false\n-          }, data);\n-          this.$store.commit('todo-lists/add', data);\n+          this.$store.dispatch('todo-lists/add', sendData);\n         } catch (e) { err = e; }\n       }\n       if (err) console.log('err:', err);","distinct":true,"url":"https://api.github.com/repos/ahyahya/local-task-app/commits/cf7e73d1755f36e3226456f73fc6336faad07813"},{"sha":"c443ab9a4bab3319e0503f8eb00e293d6f6619a5","author":{"name":"ahyahya","email":"ae35fbc40929f93c8be2d14253c84d0a300a7de7@gmail.com"},"message":"[from now] 2017/03/12 12:13:02\n\ndiff --git a/assets/js/api-driver.js b/assets/js/api-driver.js\nnew file mode 100644\nindex 0000000..e69de29\ndiff --git a/assets/js/api-validation.js b/assets/js/api-validation.js\nnew file mode 100644\nindex 0000000..3f68289\n--- /dev/null\n+++ b/assets/js/api-validation.js\n@@ -0,0 +1,15 @@\n+import validate from 'validate.js';\n+\n+const constraints = {\n+  TodoList: {\n+    name: {\n+      presence: true,\n+      length: {\n+        minimum: 1,\n+        maximum: 60\n+      }\n+    }\n+  }\n+};\n+\n+export default (data, kind) => validate(data, constraints[kind]) || null;\ndiff --git a/pages/list/_lid.vue b/pages/list/_lid.vue\nnew file mode 100644\nindex 0000000..4bb7568\n--- /dev/null\n+++ b/pages/list/_lid.vue\n@@ -0,0 +1,58 @@\n+<template>\n+  <main>\n+    <div class=\"create-todo\">\n+      <div class=\"create-todo-left\">\n+        <input type=\"text\" placeholder=\"ToDo名\" v-model=\"name\">\n+        <input type=\"text\" placeholder=\"期限\" v-model=\"deadline\">\n+      </div>\n+      <div class=\"create-todo-right\">\n+        <button @click=\"createTodo\">ついか</button>\n+      </div>\n+      <todo-detail\n+        v-for=\"todo in $store.state.todos.todos\"\n+        :name=\"todo.name\"\n+        :deadline=\"todo.deadline\"\n+        :createdAt=\"todo.createdAt\"\n+        :completed=\"todo.completed\"></todo-detail>\n+    </div>\n+  </main>\n+</template>\n+\n+<script>\n+import TodoDetail from '~components/todo-detail';\n+import axios from 'axios';\n+import validation from '~assets/js/api-validation';\n+\n+export default {\n+  components: { TodoDetail },\n+  data: _ => ({\n+    name: '',\n+    deadline: ''\n+  }),\n+  async fetch({store, params}) {\n+    const listRes = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}`);\n+    store.commit('todos/listName', listRes.data);\n+    const {data} = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}/todos`);\n+    store.commit('todos/update', data);\n+  },\n+  methods: {\n+    async createTodo(e) {\n+      const sendData = {\n+        name: this.name,\n+        deadline: this.deadline,\n+        createdAt: new Date(),\n+        completed: false\n+      };\n+      console.log(this.name, this.deadline);\n+      let err = validation(sendData, 'Todo');\n+      if (!err) {\n+        try {\n+          let {data} = await axios.post(`http://localhost:3000/api/todo-lists/${this.$route.params.lid}/todos`, sendData);\n+          this.$store.commit('todos/add', data);\n+        } catch (e) { err = e; }\n+      }\n+      if (err) console.log('err:', err);\n+    }\n+  }\n+};\n+</script>\ndiff --git a/store/todo-lists.js b/store/todo-lists.js\nnew file mode 100644\nindex 0000000..83e7e6a\n--- /dev/null\n+++ b/store/todo-lists.js\n@@ -0,0 +1,34 @@\n+import axios from 'axios';\n+\n+export const state = {\n+  lists: []\n+};\n+\n+export const mutations = {\n+  initialize(state, data) {\n+    console.log(state);\n+    // console.log('update:', data);\n+    state.lists = data;\n+    console.log(state);\n+  },\n+  add(state, data) {\n+    console.log(state);\n+    console.log('add:', data);\n+    state.lists.push(data);\n+  }\n+};\n+\n+export const actions = {\n+  async initialize({commit}) {\n+    const {data} = await axios.get('http://localhost:3000/api/todo-list-overview');\n+    commit('initialize', data);\n+  },\n+  async add({commit}, diff) {\n+    let {data} = await axios.post('http://localhost:3000/api/todo-lists', diff);\n+    data = Object.assign({\n+      count: 0,\n+      hasChild: false\n+    }, data);\n+    commit('add', data);\n+  }\n+};\ndiff --git a/store/todos.js b/store/todos.js\nnew file mode 100644\nindex 0000000..3bdb0ef\n--- /dev/null\n+++ b/store/todos.js\n@@ -0,0 +1,17 @@\n+export const state = {\n+  todos: []\n+};\n+\n+export const mutations = {\n+  update(state, data) {\n+    console.log(state);\n+    // console.log('update:', data);\n+    state.todos = data;\n+    console.log(state);\n+  },\n+  add(state, data) {\n+    console.log(state);\n+    console.log('add:', data);\n+    state.todos.push(data);\n+  }\n+};","distinct":true,"url":"https://api.github.com/repos/ahyahya/local-task-app/commits/c443ab9a4bab3319e0503f8eb00e293d6f6619a5"},{"sha":"5dbd6ef6aff5970b9b93fd7b3899ac4a05da2c01","author":{"name":"ahyahya","email":"ae35fbc40929f93c8be2d14253c84d0a300a7de7@gmail.com"},"message":"[from now] 2017/03/12 12:57:44\n\ndiff --git a/pages/index.vue b/pages/index.vue\nindex 9e8f918..109a270 100644\n--- a/pages/index.vue\n+++ b/pages/index.vue\n@@ -23,17 +23,14 @@\n\n <script>\n import ListOverview from '~components/list-overview.vue';\n-import axios from 'axios';\n import validation from '~assets/js/api-validation.js';\n\n export default {\n   components: { ListOverview },\n-  computed: {\n-    lists() {\n-      return this.$store.state['todo-lists'].lists;\n-    }\n-  },\n-  data: ({store}) => ({ name: '' }),\n+  // computed: {\n+  //   lists: _ => this.$store.state['todo-lists'].lists\n+  // },\n+  data: _ => ({ name: '' }),\n   async fetch({store}) {\n     await store.dispatch('todo-lists/initialize');\n   },\ndiff --git a/pages/list/_lid.vue b/pages/list/_lid.vue\nindex 4bb7568..6de74aa 100644\n--- a/pages/list/_lid.vue\n+++ b/pages/list/_lid.vue\n@@ -1,5 +1,6 @@\n <template>\n   <main>\n+    <h2>リスト名：{{$store.state.todos.listName}}</h2>\n     <div class=\"create-todo\">\n       <div class=\"create-todo-left\">\n         <input type=\"text\" placeholder=\"ToDo名\" v-model=\"name\">\n@@ -8,13 +9,13 @@\n       <div class=\"create-todo-right\">\n         <button @click=\"createTodo\">ついか</button>\n       </div>\n-      <todo-detail\n-        v-for=\"todo in $store.state.todos.todos\"\n-        :name=\"todo.name\"\n-        :deadline=\"todo.deadline\"\n-        :createdAt=\"todo.createdAt\"\n-        :completed=\"todo.completed\"></todo-detail>\n     </div>\n+    <todo-detail\n+      v-for=\"todo in $store.state.todos.todos\"\n+      :name=\"todo.name\"\n+      :deadline=\"todo.deadline\"\n+      :createdAt=\"todo.createdAt\"\n+      :completed=\"todo.completed\"></todo-detail>\n   </main>\n </template>\n\n@@ -30,10 +31,12 @@ export default {\n     deadline: ''\n   }),\n   async fetch({store, params}) {\n-    const listRes = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}`);\n-    store.commit('todos/listName', listRes.data);\n-    const {data} = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}/todos`);\n-    store.commit('todos/update', data);\n+    await store.dispatch('todos/initialize', params.lid);\n+    // await store.dispatch('todos/update', params.lid);\n+    // const listRes = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}`);\n+    // store.commit('todos/listName', listRes.data);\n+    // const {data} = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}/todos`);\n+    // store.commit('todos/update', data);\n   },\n   methods: {\n     async createTodo(e) {\ndiff --git a/store/todos.js b/store/todos.js\nindex 3bdb0ef..d2fc71a 100644\n--- a/store/todos.js\n+++ b/store/todos.js\n@@ -1,13 +1,15 @@\n+import axios from 'axios';\n+// import Promise from 'bluebird';\n+\n export const state = {\n+  listName: '',\n   todos: []\n };\n\n export const mutations = {\n-  update(state, data) {\n-    console.log(state);\n-    // console.log('update:', data);\n-    state.todos = data;\n-    console.log(state);\n+  initialize(state, {listName, todos}) {\n+    state.listName = listName;\n+    state.todos = todos;\n   },\n   add(state, data) {\n     console.log(state);\n@@ -15,3 +17,15 @@ export const mutations = {\n     state.todos.push(data);\n   }\n };\n+\n+export const actions = {\n+  async initialize({commit}, lid) {\n+    const p1 = axios.get(`http://localhost:3000/api/todo-lists/${lid}`);\n+    const p2 = axios.get(`http://localhost:3000/api/todo-lists/${lid}/todos`);\n+    const [res1, res2] = await Promise.all([p1, p2]);\n+    commit('initialize', {\n+      listName: res1.data.name,\n+      todos: res2.data\n+    });\n+  }\n+};","distinct":true,"url":"https://api.github.com/repos/ahyahya/local-task-app/commits/5dbd6ef6aff5970b9b93fd7b3899ac4a05da2c01"},{"sha":"0c3d58fd0e53d2e9d92ad6f18a9120655b8d5e10","author":{"name":"ahyahya","email":"ae35fbc40929f93c8be2d14253c84d0a300a7de7@gmail.com"},"message":"[from now] 2017/03/12 13:05:22\n\ndiff --git a/pages/list/_lid.vue b/pages/list/_lid.vue\nindex 6de74aa..a2339c0 100644\n--- a/pages/list/_lid.vue\n+++ b/pages/list/_lid.vue\n@@ -21,7 +21,6 @@\n\n <script>\n import TodoDetail from '~components/todo-detail';\n-import axios from 'axios';\n import validation from '~assets/js/api-validation';\n\n export default {\n@@ -32,11 +31,6 @@ export default {\n   }),\n   async fetch({store, params}) {\n     await store.dispatch('todos/initialize', params.lid);\n-    // await store.dispatch('todos/update', params.lid);\n-    // const listRes = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}`);\n-    // store.commit('todos/listName', listRes.data);\n-    // const {data} = await axios.get(`http://localhost:3000/api/todo-lists/${params.lid}/todos`);\n-    // store.commit('todos/update', data);\n   },\n   methods: {\n     async createTodo(e) {\n@@ -46,12 +40,10 @@ export default {\n         createdAt: new Date(),\n         completed: false\n       };\n-      console.log(this.name, this.deadline);\n       let err = validation(sendData, 'Todo');\n       if (!err) {\n         try {\n-          let {data} = await axios.post(`http://localhost:3000/api/todo-lists/${this.$route.params.lid}/todos`, sendData);\n-          this.$store.commit('todos/add', data);\n+          this.$store.dispatch('todos/add', sendData);\n         } catch (e) { err = e; }\n       }\n       if (err) console.log('err:', err);\ndiff --git a/store/todo-lists.js b/store/todo-lists.js\nindex 83e7e6a..0298d59 100644\n--- a/store/todo-lists.js\n+++ b/store/todo-lists.js\n@@ -6,14 +6,9 @@ export const state = {\n\n export const mutations = {\n   initialize(state, data) {\n-    console.log(state);\n-    // console.log('update:', data);\n     state.lists = data;\n-    console.log(state);\n   },\n   add(state, data) {\n-    console.log(state);\n-    console.log('add:', data);\n     state.lists.push(data);\n   }\n };\ndiff --git a/store/todos.js b/store/todos.js\nindex d2fc71a..a0c7164 100644\n--- a/store/todos.js\n+++ b/store/todos.js\n@@ -12,8 +12,6 @@ export const mutations = {\n     state.todos = todos;\n   },\n   add(state, data) {\n-    console.log(state);\n-    console.log('add:', data);\n     state.todos.push(data);\n   }\n };\n@@ -27,5 +25,9 @@ export const actions = {\n       listName: res1.data.name,\n       todos: res2.data\n     });\n+  },\n+  async add({commit}, diff) {\n+    let {data} = await axios.post(`http://localhost:3000/api/todo-lists/${this.$route.params.lid}/todos`, diff);\n+    commit('add', data);\n   }\n };","distinct":true,"url":"https://api.github.com/repos/ahyahya/local-task-app/commits/0c3d58fd0e53d2e9d92ad6f18a9120655b8d5e10"}]}
{"actor":{"display_login":"ahyahya"}}