mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
fixed newsfeed data that was not unique
This commit is contained in:
parent
201b02ac1d
commit
508838179d
@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<ds-flex
|
||||
v-if="Post && Post.length"
|
||||
:width="{ base: '100%' }"
|
||||
gutter="base">
|
||||
<ds-flex-item
|
||||
v-for="post in Post"
|
||||
v-for="post in uniq(Post)"
|
||||
:width="{ base: '100%', xs: '100%', md: '50%', xl: '33%' }"
|
||||
:key="post.id">
|
||||
<hc-post-card :post="post" />
|
||||
@ -19,6 +20,7 @@
|
||||
|
||||
<script>
|
||||
import gql from 'graphql-tag'
|
||||
import uniqBy from 'lodash/uniqBy'
|
||||
import HcPostCard from '~/components/PostCard.vue'
|
||||
import HcLoadMore from '~/components/LoadMore.vue'
|
||||
|
||||
@ -44,6 +46,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
uniq(items, field = 'id') {
|
||||
return uniqBy(items, field)
|
||||
},
|
||||
href(post) {
|
||||
return this.$router.resolve({
|
||||
name: 'post-slug',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user