logs-content: Added move up/down mutations
This commit is contained in:
+22
-1
@@ -23,4 +23,25 @@ class Post {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {Post}
|
||||
class PostAPI {
|
||||
/**
|
||||
* Call `movePost(input)` mutation, returns the id and position of all affected posts.
|
||||
*
|
||||
* @param {{id:string, toPosition: number}} input
|
||||
* @returns {Promise<{id:string, position:number}[]>}
|
||||
*/
|
||||
move(input) {
|
||||
return query(`
|
||||
mutation MovePost($input: PostMoveInput!) {
|
||||
movePost(input: $input) {
|
||||
id
|
||||
position
|
||||
}
|
||||
}
|
||||
`, {input}, {permissions: ["post.move"]}).then(({movePost}) => {
|
||||
return movePost
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {Post, postApi: new PostAPI}
|
||||
Reference in New Issue
Block a user