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
|
@action
|
||||||
setCustomField(field, target) {
|
setCustomField(field, e) {
|
||||||
this.args.model.updateCustomField(field, target.value);
|
this.args.model.updateCustomField(field, e.target.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import EmberObject from "@ember/object";
|
||||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||||
import PostEventBuilder from "../components/modal/post-event-builder";
|
import PostEventBuilder from "../components/modal/post-event-builder";
|
||||||
import {
|
import {
|
||||||
|
|
@ -20,7 +21,7 @@ function initializeEventBuilder(api) {
|
||||||
const eventModel = store.createRecord("discourse-post-event-event");
|
const eventModel = store.createRecord("discourse-post-event-event");
|
||||||
eventModel.setProperties({
|
eventModel.setProperties({
|
||||||
status: "public",
|
status: "public",
|
||||||
custom_fields: {},
|
custom_fields: EmberObject.create({}),
|
||||||
starts_at: moment(),
|
starts_at: moment(),
|
||||||
timezone: moment.tz.guess(),
|
timezone: moment.tz.guess(),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue