@kohanajs/mod-cms
Advanced tools
Comparing version 9.3.0 to 9.4.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [9.4.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v9.3.0...v9.4.0) (2022-07-28) | ||
### Features | ||
* page schedule sync with live version ([16b925b](https://gitlab.com/kohana-js/proposals/level0/mod-cms/commit/16b925bc35f68dc59067fae415866f3a9582c7ca)) | ||
## [9.3.0](https://gitlab.com/kohana-js/proposals/level0/mod-cms/compare/v9.2.0...v9.3.0) (2022-07-27) | ||
@@ -7,0 +14,0 @@ |
@@ -90,2 +90,5 @@ const { ControllerAdmin } = require('@kohanajs/mod-admin'); | ||
//page start and end should sync with live version | ||
await this.updateLiveSchedule(instance); | ||
if($_POST['action'] === "publish"){ | ||
@@ -99,2 +102,11 @@ await this.publish(instance); | ||
async updateLiveSchedule(instance){ | ||
const database = this.state.get(ControllerMixinDatabase.DATABASES).get('live'); | ||
const livePage = await ORM.readBy(Page, 'id', [instance.id], {database, limit: 1, asArray: false}); | ||
if(!livePage)return; | ||
livePage.start = instance.start; | ||
livePage.end = instance.end; | ||
await livePage.write(); | ||
} | ||
async unpublish(id){ | ||
@@ -101,0 +113,0 @@ const database = this.state.get(ControllerMixinDatabase.DATABASES).get('live'); |
{ | ||
"name": "@kohanajs/mod-cms", | ||
"version": "9.3.0", | ||
"version": "9.4.0", | ||
"description": "The CMS module for KohanaJS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103788
1366