FIX: Updating custom fields with new value (#495)
We were incorrectly access the input value from `setCustomField`. Additionally, we can only call `.set` on a `EmberObject`, which we were initializing the `custom_fields` with a empty hash (`{}`) causing the `set` call to fail.
This commit is contained in:
parent
1c5beb4432
commit
68a62b1265
|
@ -73,8 +73,8 @@ export default class PostEventBuilder extends Component {
|
|||
}
|
||||
|
||||
@action
|
||||
setCustomField(field, target) {
|
||||
this.args.model.updateCustomField(field, target.value);
|
||||
setCustomField(field, e) {
|
||||
this.args.model.updateCustomField(field, e.target.value);
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import EmberObject from "@ember/object";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import PostEventBuilder from "../components/modal/post-event-builder";
|
||||
import {
|
||||
|
@ -20,7 +21,7 @@ function initializeEventBuilder(api) {
|
|||
const eventModel = store.createRecord("discourse-post-event-event");
|
||||
eventModel.setProperties({
|
||||
status: "public",
|
||||
custom_fields: {},
|
||||
custom_fields: EmberObject.create({}),
|
||||
starts_at: moment(),
|
||||
timezone: moment.tz.guess(),
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue