story: Added add story modal, reorganized story page to allow modals and live updates.
This commit is contained in:
@@ -194,6 +194,50 @@ const storyApi = {
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Call `addStory(input)` mutation, returns the ID.
|
||||
*
|
||||
* @param {{name:string, category:string, author:string, open:boolean, listed:boolean, fictionalDate:Date, tags:Tag[]}} input
|
||||
* @returns {Promise<Story>}
|
||||
*/
|
||||
add(input) {
|
||||
return query(`
|
||||
mutation AddStory($input: StoryAddInput!) {
|
||||
addStory(input:$input) {
|
||||
id
|
||||
name
|
||||
author
|
||||
category
|
||||
tags {
|
||||
kind
|
||||
name
|
||||
}
|
||||
listed
|
||||
open
|
||||
createdDate
|
||||
fictionalDate
|
||||
updatedDate
|
||||
chapters {
|
||||
id
|
||||
title
|
||||
author
|
||||
source
|
||||
createdDate
|
||||
fictionalDate
|
||||
editedDate
|
||||
}
|
||||
}
|
||||
}
|
||||
`, {input}, {permissions: ["member", "story.edit"]}).then(({addStory}) => {
|
||||
return new Story(
|
||||
addStory.id, addStory.name, addStory.author, addStory.category,
|
||||
addStory.listed, addStory.open,
|
||||
addStory.createdDate, addStory.updatedDate, addStory.fictionalDate,
|
||||
addStory.tags, addStory.chapters
|
||||
)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* Call `editStory(input)` mutation, returns the changable fields.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user