logs-content: Added remove modal, fixed move up/down mutations

This commit is contained in:
2018-09-30 14:21:04 +02:00
parent 6cb1043004
commit ba2b827119
8 changed files with 122 additions and 7 deletions
+18
View File
@@ -42,6 +42,24 @@ class PostAPI {
return movePost
})
}
/**
* Call `removePost(input)` mutation, returns the id of the affected post.
*
* @param {{id:string, toPosition: number}} input
* @returns {Promise<{id:string}>}
*/
remove(input) {
return query(`
mutation RemovePost($input: PostRemoveInput!) {
removePost(input: $input) {
id
}
}
`, {input}, {permissions: ["post.remove"]}).then(({removePost}) => {
return removePost
})
}
}
module.exports = {Post, postApi: new PostAPI}