logs-content: Enabled altering of history (added edit options for log posts)

This commit is contained in:
2018-09-30 15:33:25 +02:00
parent db069d1c1a
commit 3c35f75f62
7 changed files with 127 additions and 1 deletions
+22
View File
@@ -43,6 +43,28 @@ class PostAPI {
})
}
/**
* Call `editPost(input)` mutation, returns the id and edited fields of the post
*
* @param {{id:string, time:Date, kind:string, nick:string, text:string}} input
* @returns {Promise<{id:string, time:Date, kind:string, nick:string, text:string}>}
*/
edit(input) {
return query(`
mutation RemovePost($input: PostEditInput!) {
editPost(input: $input) {
id
time
kind
nick
text
}
}
`, {input}, {permissions: ["post.edit"]}).then(({editPost}) => {
return editPost
})
}
/**
* Call `removePost(input)` mutation, returns the id of the affected post.
*