Skip to content

Commit ef8e8b5

Browse files
committed
Lesson 3 starting
1 parent 20c27e0 commit ef8e8b5

File tree

3 files changed

+3
-80
lines changed

3 files changed

+3
-80
lines changed

src/router.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Vue from 'vue'
22
import Router from 'vue-router'
33
import Home from './views/Home.vue'
44
import Dashboard from './views/Dashboard.vue'
5-
import RegisterUser from './views/RegisterUser.vue'
65

76
Vue.use(Router)
87

@@ -19,11 +18,6 @@ const router = new Router({
1918
path: '/dashboard',
2019
name: 'dashboard',
2120
component: Dashboard
22-
},
23-
{
24-
path: '/register',
25-
name: 'register',
26-
component: RegisterUser
2721
}
2822
]
2923
})

src/store.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
11
import Vue from 'vue'
22
import Vuex from 'vuex'
3-
import axios from 'axios'
43

54
Vue.use(Vuex)
65

76
export default new Vuex.Store({
8-
state: {
9-
user: null
10-
},
11-
mutations: {
12-
SET_USER_DATA (state, userData) {
13-
state.user = userData
14-
localStorage.setItem('user', JSON.stringify(userData))
15-
axios.defaults.headers.common['Authorization'] = `Bearer ${
16-
userData.token
17-
}`
18-
}
19-
},
20-
actions: {
21-
register ({ commit }, credentials) {
22-
return axios
23-
.post('//localhost:3000/register', credentials)
24-
.then(({ data }) => {
25-
commit('SET_USER_DATA', data)
26-
})
27-
}
28-
}
7+
state: {},
8+
mutations: {},
9+
actions: {}
2910
})

src/views/RegisterUser.vue

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)