unpinpost

This commit is contained in:
Ulf Gebhardt 2026-01-15 17:25:43 +01:00
parent bcc19db2f4
commit feb905b489
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
3 changed files with 8 additions and 10 deletions

View File

@ -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 },
})

View File

@ -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',
})
}

View File

@ -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)