|
|
@@ -55,28 +55,7 @@ export default {
|
|
55
|
55
|
posts() {
|
|
56
|
56
|
let type = convertTitleCase(this.type)
|
|
57
|
57
|
if(!type) return
|
|
58
|
|
-
|
|
59
|
|
- /**
|
|
60
|
|
- * We override the API to sort by date
|
|
61
|
|
- * because items are returned by ID so
|
|
62
|
|
- * we need to re-sort it by date
|
|
63
|
|
- */
|
|
64
|
|
- let unsortedOfType = Object.values(this[`all${type}`])
|
|
65
|
|
- let sortedByRecent = unsortedOfType.sort((postA, postB) => new Date(postB.date) - new Date(postA.date))
|
|
66
|
|
-
|
|
67
|
|
- /**
|
|
68
|
|
- * Sorting of this[`all${type}`] is also controlled by API
|
|
69
|
|
- * so if a sortBy is specified we return it sorted or
|
|
70
|
|
- * we fail over to sorted by date
|
|
71
|
|
- */
|
|
72
|
|
- let returnList = sortedByRecent
|
|
73
|
|
- if(this.sortBy && sortTypes.includes(this.sortBy)) {
|
|
74
|
|
- returnList = this[`all${type}`]
|
|
75
|
|
- }
|
|
76
|
|
- if(['exhibitions', 'events'].includes(this.type)) {
|
|
77
|
|
- returnList = this[`all${type}`]
|
|
78
|
|
- }
|
|
79
|
|
- return returnList
|
|
|
58
|
+ return this[`all${type}`]
|
|
80
|
59
|
},
|
|
81
|
60
|
},
|
|
82
|
61
|
methods: {
|