mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-16 09:54:41 +00:00
unpinpost
This commit is contained in:
parent
bcc19db2f4
commit
feb905b489
@ -503,9 +503,10 @@ export default {
|
||||
unpinGroupPost: async (_parent, params, context, _resolveInfo) => {
|
||||
const result = await context.database.write({
|
||||
query: `
|
||||
MATCH [pinned:GROUP_PINNED]->(post:Post {id: $postId})
|
||||
MATCH (post:Post {id: $postId})
|
||||
OPTIONAL MATCH (:User)-[pinned:GROUP_PINNED]->(post)
|
||||
DELETE pinned
|
||||
RETURN post`,
|
||||
RETURN post {.*}`,
|
||||
variables: { postId: params.id },
|
||||
})
|
||||
|
||||
|
||||
@ -249,19 +249,16 @@ export default {
|
||||
this.resourceType === 'contribution' &&
|
||||
this.resource.group &&
|
||||
this.resource.group.myRole === 'owner' &&
|
||||
(this.canBeGroupPinned || this.resource.groupPinnedBy)
|
||||
(this.canBeGroupPinned || this.resource.groupPinned)
|
||||
) {
|
||||
routes.push({
|
||||
label: this.resource.groupPinnedBy
|
||||
label: this.resource.groupPinned
|
||||
? this.$t(`post.menu.groupUnpin`)
|
||||
: this.$t(`post.menu.groupPin`),
|
||||
callback: () => {
|
||||
this.$emit(
|
||||
this.resource.groupPinnedBy ? 'unpinGroupPost' : 'pinGroupPost',
|
||||
this.resource,
|
||||
)
|
||||
this.$emit(this.resource.groupPinned ? 'unpinGroupPost' : 'pinGroupPost', this.resource)
|
||||
},
|
||||
icon: this.resource.groupPinnedBy ? 'unlink' : 'link',
|
||||
icon: this.resource.groupPinned ? 'unlink' : 'link',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -240,7 +240,7 @@ export default {
|
||||
this.$emit('pinGroupPost', post)
|
||||
},
|
||||
unpinGroupPost(post) {
|
||||
this.$emit('unpinPost', post)
|
||||
this.$emit('unpinGroupPost', post)
|
||||
},
|
||||
pushPost(post) {
|
||||
this.$emit('pushPost', post)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user