mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Expose Composer.serializeToTopic
in client side plugin api.
This commit is contained in:
parent
858735b5da
commit
f9a9bd136b
@ -55,7 +55,7 @@ import { on } from "@ember/object/evented";
|
|||||||
import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts";
|
import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts";
|
||||||
|
|
||||||
// If you add any methods to the API ensure you bump up this number
|
// If you add any methods to the API ensure you bump up this number
|
||||||
const PLUGIN_API_VERSION = "0.9.0";
|
const PLUGIN_API_VERSION = "0.10.0";
|
||||||
|
|
||||||
class PluginApi {
|
class PluginApi {
|
||||||
constructor(version, container) {
|
constructor(version, container) {
|
||||||
@ -941,6 +941,21 @@ class PluginApi {
|
|||||||
Composer.reopen({ beforeSave: method });
|
Composer.reopen({ beforeSave: method });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a field to topic edit serializer
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
*
|
||||||
|
* api.serializeToTopic('key_set_in_model', 'field_name_in_payload');
|
||||||
|
*
|
||||||
|
* to keep both of them same
|
||||||
|
* api.serializeToTopic('field_name');
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
serializeToTopic(fieldName, property) {
|
||||||
|
Composer.serializeToTopic(fieldName, property);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a field to draft serializer
|
* Adds a field to draft serializer
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user