feat(v4): Update Inbox view card design (#10599)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { sortComparator } from './helpers';
|
||||
import camelcaseKeys from 'camelcase-keys';
|
||||
|
||||
export const getters = {
|
||||
getNotifications($state) {
|
||||
@@ -11,6 +12,13 @@ export const getters = {
|
||||
);
|
||||
return sortedNotifications;
|
||||
},
|
||||
getFilteredNotificationsV4: $state => filters => {
|
||||
const sortOrder = filters.sortOrder === 'desc' ? 'newest' : 'oldest';
|
||||
const sortedNotifications = Object.values($state.records).sort((n1, n2) =>
|
||||
sortComparator(n1, n2, sortOrder)
|
||||
);
|
||||
return camelcaseKeys(sortedNotifications, { deep: true });
|
||||
},
|
||||
getNotificationById: $state => id => {
|
||||
return $state.records[id] || {};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user