Skip to content

Commit c77b085

Browse files
authored
Merge pull request #4 from treby/make-data-user-oriented
fix: make data user oriented.
2 parents e19e1ab + 11aec87 commit c77b085

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

src/components/App.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<script>
1717
import data from '@/data'
1818
import store from '@/store'
19-
import Todo from '@/models/Todo'
19+
import User from '@/models/User'
2020
import AppHeader from './AppHeader'
2121
import AppDescription from './AppDescription'
2222
import UsersSection from './UsersSection'
@@ -45,7 +45,7 @@ export default {
4545
// should be the response from the API Backend.
4646
const initialData = data
4747
48-
Todo.insert({ data: initialData })
48+
User.insert({ data: initialData })
4949
}
5050
}
5151
</script>

src/data.js

+18-11
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@
22
// in the real world.
33
export default [
44
{
5-
title: 'Create awesome application!',
6-
done: false,
7-
assignee: { name: 'John Doe' }
5+
name: 'John Doe',
6+
todos: [
7+
{
8+
title: 'Create awesome application!',
9+
done: false
10+
},
11+
{
12+
title: 'Read the documentation',
13+
done: false
14+
}
15+
]
816
},
917
{
10-
title: 'Read the documentation',
11-
done: false,
12-
assignee: { name: 'John Doe' }
13-
},
14-
{
15-
title: 'Star Vuex ORM repository',
16-
done: false,
17-
assignee: { name: 'Johnny Doe' }
18+
name: 'Johnny Doe',
19+
todos: [
20+
{
21+
title: 'Star Vuex ORM repository',
22+
done: false
23+
}
24+
]
1825
}
1926
]

0 commit comments

Comments
 (0)