listing modifications + added description to segments

This commit is contained in:
Jonathan Labreuille
2015-10-22 19:19:40 +02:00
parent b9b17a59a3
commit 4bde705f04
12 changed files with 289 additions and 61 deletions

View File

@@ -70,10 +70,21 @@ define(
this.setState({ loading: true });
// only get values from displayed fields
item = {};
this.props.fields.map(function(field) {
item[field.name] = this.state.item[field.name];
}.bind(this));
// set id if specified
if(this.props.params.id !== undefined) {
item.id = this.props.params.id;
}
MailPoet.Ajax.post({
endpoint: this.props.endpoint,
action: 'save',
data: this.state.item
data: item
}).done(function(response) {
this.setState({ loading: false });