@rmdes/indiekit-endpoint-posts 1.0.0-beta.43 → 1.0.0-beta.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,6 +85,15 @@ export const formController = {
85
85
  delete values.postType;
86
86
  delete values["publication-date"];
87
87
 
88
+ // Map content-warning text to summary when post is marked sensitive
89
+ // and the post type doesn't have its own summary field
90
+ if (values.sensitive && values["content-warning"]) {
91
+ if (!values.summary) {
92
+ values.summary = values["content-warning"];
93
+ }
94
+ }
95
+ delete values["content-warning"];
96
+
88
97
  // Easy MDE appends `image` value to formData for last image uploaded
89
98
  delete values.image;
90
99
 
@@ -62,6 +62,7 @@ export const postsController = async (request, response, next) => {
62
62
  item.icon = item["post-type"];
63
63
  item.locale = application.locale;
64
64
  item.photo = getPhotoUrl(publication, item);
65
+
65
66
  item.description = {
66
67
  text:
67
68
  item.summary ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-posts",
3
- "version": "1.0.0-beta.43",
3
+ "version": "1.0.0-beta.44",
4
4
  "description": "Post management endpoint for Indiekit with syndicate form fix. View posts published by your Micropub endpoint and publish new posts to it.",
5
5
  "keywords": [
6
6
  "indiekit",
@@ -82,8 +82,8 @@
82
82
  label: __("posts.form.sensitive.hint"),
83
83
  value: "true",
84
84
  conditional: input({
85
- name: "summary",
86
- value: properties.summary,
85
+ name: "content-warning",
86
+ value: properties["content-warning"],
87
87
  label: __("posts.form.summary.label"),
88
88
  optional: true
89
89
  })