mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Merge branch 'master' into fix-search-3-chars
This commit is contained in:
commit
bbe77c7ddd
@ -310,6 +310,7 @@ export default {
|
|||||||
`
|
`
|
||||||
MATCH (user:User {id: $userId}) WHERE user.role = 'admin'
|
MATCH (user:User {id: $userId}) WHERE user.role = 'admin'
|
||||||
MATCH (post:Post {id: $params.id})
|
MATCH (post:Post {id: $params.id})
|
||||||
|
WHERE NOT((post)-[:IN]->(:Group))
|
||||||
MERGE (user)-[pinned:PINNED {createdAt: toString(datetime())}]->(post)
|
MERGE (user)-[pinned:PINNED {createdAt: toString(datetime())}]->(post)
|
||||||
SET post.pinned = true
|
SET post.pinned = true
|
||||||
RETURN post, pinned.createdAt as pinnedAt
|
RETURN post, pinned.createdAt as pinnedAt
|
||||||
@ -322,10 +323,12 @@ export default {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
const [transactionResult] = await writeTxResultPromise
|
const [transactionResult] = await writeTxResultPromise
|
||||||
const { pinnedPost, pinnedAt } = transactionResult
|
if (transactionResult) {
|
||||||
pinnedPostWithNestedAttributes = {
|
const { pinnedPost, pinnedAt } = transactionResult
|
||||||
...pinnedPost,
|
pinnedPostWithNestedAttributes = {
|
||||||
pinnedAt,
|
...pinnedPost,
|
||||||
|
pinnedAt,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
session.close()
|
session.close()
|
||||||
|
|||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isAdmin) {
|
if (this.isAdmin && !this.resource.group) {
|
||||||
if (!this.resource.pinnedBy) {
|
if (!this.resource.pinnedBy) {
|
||||||
routes.push({
|
routes.push({
|
||||||
label: this.$t(`post.menu.pin`),
|
label: this.$t(`post.menu.pin`),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user