Skip to content
Commits on Source (5)
# [1.39.0](https://gitlab.coko.foundation/ketida/server/compare/v1.38.9...v1.39.0) (2024-10-29)
### Bug Fixes
* **api/graphql:** create new mutation to rename book component ([a28cf5e](https://gitlab.coko.foundation/ketida/server/commit/a28cf5efd77acb33839ee3f08aa0d526a3be7fe4))
### Features
* update pagedjs microservice version and env variables ([0cc79b4](https://gitlab.coko.foundation/ketida/server/commit/0cc79b401b177846e8664cf494543ad24f9f83f3))
# [1.36.0](https://gitlab.coko.foundation/ketida/server/compare/v1.35.0...v1.36.0) (2024-07-24)
......
......@@ -137,6 +137,7 @@ extend type Mutation {
addBookComponent(input: BookComponentInput): BookComponent!
podAddBookComponent(input: BookComponentInput): BookComponent!
renameBookComponent(input: UpdateBookComponentInput): BookComponent!
renameBookComponentTitle(id: ID!, title: String!): BookComponent!
deleteBookComponent(input: UpdateBookComponentInput): BookComponent!
podDeleteBookComponent(input: UpdateBookComponentInput): Book!
archiveBookComponent(input: UpdateBookComponentInput): BookComponent!
......
......@@ -292,6 +292,34 @@ const renameBookComponentHandler = async (_, { input }, ctx) => {
}
}
// used in ketty
const renameBookComponentTitleHandler = async (_, { id, title }, ctx) => {
try {
const pubsub = await pubsubManager.getPubsub()
await renameBookComponent(id, title, 'en')
const updatedBookComponent = await getBookComponent(id)
pubsub.publish(BOOK_COMPONENT_TITLE_UPDATED, {
bookComponentTitleUpdated: updatedBookComponent.id,
})
pubsub.publish(BOOK_COMPONENT_UPDATED, {
bookComponentUpdated: updatedBookComponent.id,
})
pubsub.publish(BOOK_UPDATED, {
bookUpdated: updatedBookComponent.bookId,
})
logger.info('message BOOK_COMPONENT_TITLE_UPDATED broadcasted')
return updatedBookComponent
} catch (e) {
logger.error(e.message)
throw new Error(e)
}
}
const deleteBookComponentHandler = async (_, { input }, ctx) => {
try {
const { id } = input
......@@ -703,6 +731,7 @@ module.exports = {
addBookComponent: addBookComponentHandler,
podAddBookComponent: podAddBookComponentHandler,
renameBookComponent: renameBookComponentHandler,
renameBookComponentTitle: renameBookComponentTitleHandler,
deleteBookComponent: deleteBookComponentHandler,
podDeleteBookComponent: podDeleteBookComponentHandler,
updateWorkflowState: updateWorkflowStateHandler,
......
{
"name": "server",
"version": "1.36.0",
"version": "1.39.0",
"private": true,
"description": "Ketida's Platform common server",
"repository": {
......