mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
"commentedCount" is different from "commentsCount"
One is how many comments you wrote, one is how many **posts** are there with at least one comment of you. E.g. you can comment twice on the same post. You will have a `commentedCount` increase of 1 but a `commentsCount` of 2. FYI @ogerly @Tirokk
This commit is contained in:
parent
d3a70321b8
commit
574b42a2a7
@ -64,6 +64,7 @@ type User {
|
|||||||
|
|
||||||
comments: [Comment]! @relation(name: "WROTE", direction: "OUT")
|
comments: [Comment]! @relation(name: "WROTE", direction: "OUT")
|
||||||
commentsCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)")
|
commentsCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)")
|
||||||
|
commentedCount: Int! @cypher(statement: "MATCH (this)-[:WROTE]->(r:Comment)-[:COMMENTS]->(p:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true AND NOT p.deleted = true AND NOT p.disabled = true RETURN COUNT(DISTINCT(p))")
|
||||||
|
|
||||||
shouted: [Post]! @relation(name: "SHOUTED", direction: "OUT")
|
shouted: [Post]! @relation(name: "SHOUTED", direction: "OUT")
|
||||||
shoutedCount: Int! @cypher(statement: "MATCH (this)-[:SHOUTED]->(r:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(DISTINCT r)")
|
shoutedCount: Int! @cypher(statement: "MATCH (this)-[:SHOUTED]->(r:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(DISTINCT r)")
|
||||||
|
|||||||
@ -24,7 +24,7 @@ export default i18n => {
|
|||||||
}
|
}
|
||||||
badgesCount
|
badgesCount
|
||||||
shoutedCount
|
shoutedCount
|
||||||
commentsCount
|
commentedCount
|
||||||
followingCount
|
followingCount
|
||||||
following(first: 7) {
|
following(first: 7) {
|
||||||
id
|
id
|
||||||
|
|||||||
@ -154,7 +154,7 @@
|
|||||||
<ds-space margin="small">
|
<ds-space margin="small">
|
||||||
<no-ssr placeholder="Loading...">
|
<no-ssr placeholder="Loading...">
|
||||||
<ds-number :label="$t('profile.commented')">
|
<ds-number :label="$t('profile.commented')">
|
||||||
<hc-count-to slot="count" :end-val="user.commentsCount" />
|
<hc-count-to slot="count" :end-val="user.commentedCount" />
|
||||||
</ds-number>
|
</ds-number>
|
||||||
</no-ssr>
|
</no-ssr>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
@ -273,10 +273,18 @@ export default {
|
|||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 6,
|
pageSize: 6,
|
||||||
tabActive: 'post',
|
tabActive: 'post',
|
||||||
filter
|
filter,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
hasMore() {
|
||||||
|
const total = {
|
||||||
|
post: this.user.contributionsCount,
|
||||||
|
shout: this.user.shoutedCount,
|
||||||
|
comment: this.user.commentedCount,
|
||||||
|
}[this.tabActive]
|
||||||
|
return this.Post && this.Post.length < total
|
||||||
|
},
|
||||||
myProfile() {
|
myProfile() {
|
||||||
return this.$route.params.id === this.$store.getters['auth/user'].id
|
return this.$route.params.id === this.$store.getters['auth/user'].id
|
||||||
},
|
},
|
||||||
@ -290,11 +298,6 @@ export default {
|
|||||||
offset() {
|
offset() {
|
||||||
return (this.page - 1) * this.pageSize
|
return (this.page - 1) * this.pageSize
|
||||||
},
|
},
|
||||||
hasMore() {
|
|
||||||
return (
|
|
||||||
this.Post && this.Post.length < this.user.contributionsCount
|
|
||||||
)
|
|
||||||
},
|
|
||||||
activePosts() {
|
activePosts() {
|
||||||
if (!this.Post) {
|
if (!this.Post) {
|
||||||
return []
|
return []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user