logs-content: Added remove modal, fixed move up/down mutations
This commit is contained in:
@@ -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}
|
||||
Reference in New Issue
Block a user