|
|
@@ -62,7 +62,11 @@ export default {
|
|
62
|
62
|
},
|
|
63
|
63
|
},
|
|
64
|
64
|
methods: {
|
|
65
|
|
- getPosts() {
|
|
|
65
|
+ getPosts(offset) {
|
|
|
66
|
+ // Limit
|
|
|
67
|
+ let params = {
|
|
|
68
|
+ limit: 20
|
|
|
69
|
+ }
|
|
66
|
70
|
// Sorting
|
|
67
|
71
|
let sort = this.sortBy
|
|
68
|
72
|
? this.sortBy
|
|
|
@@ -79,18 +83,20 @@ export default {
|
|
79
|
83
|
|
|
80
|
84
|
// Don't dispatch if there's no type
|
|
81
|
85
|
if (this.type && this.dispatchName) {
|
|
82
|
|
- this.$store.dispatch(this.dispatchName, sort)
|
|
|
86
|
+ this.$store.dispatch(this.dispatchName, sort, params)
|
|
83
|
87
|
|
|
84
|
88
|
if (this.type == 'event') {
|
|
85
|
89
|
this.$store.dispatch(
|
|
86
|
90
|
'getAllExhibitions',
|
|
87
|
91
|
sortTypes.currentAndUpcoming,
|
|
|
92
|
+ params
|
|
88
|
93
|
)
|
|
89
|
94
|
}
|
|
90
|
95
|
if (this.type == 'exhibition') {
|
|
91
|
96
|
this.$store.dispatch(
|
|
92
|
97
|
'getAllEvents',
|
|
93
|
98
|
sortTypes.currentAndUpcoming,
|
|
|
99
|
+ params
|
|
94
|
100
|
)
|
|
95
|
101
|
}
|
|
96
|
102
|
}
|
|
|
@@ -158,7 +164,9 @@ export default {
|
|
158
|
164
|
let type = convertTitleCase(this.type) + 's'
|
|
159
|
165
|
this.checkAndSetHero(this.type)
|
|
160
|
166
|
|
|
161
|
|
- if (!this[`all${type}Loaded`]) this.getPosts()
|
|
|
167
|
+ // We also need to check if only ONE has been loaded because
|
|
|
168
|
+ // coming from the homepage there will only be 1 item
|
|
|
169
|
+ if (!this[`all${type}Loaded`] || this[`all${type}`].length < 2) this.getPosts()
|
|
162
|
170
|
},
|
|
163
|
171
|
}
|
|
164
|
172
|
</script>
|