Skip to content

Commit

Permalink
Merge pull request #46 from tomaszrondio/master
Browse files Browse the repository at this point in the history
fix: targeted publishing update rule state
  • Loading branch information
takeit authored Jun 20, 2018
2 parents 3fa6145 + 82e8df0 commit ffe9475
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 1 addition & 4 deletions client/extensions/targetedPublishing/TargetedPublishing.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ export class TargetedPublishing extends React.Component {
}

evaluate() {
this.setState({
loading: true
});
return axios.post(this.state.apiUrl + 'organization/rules/evaluate',this.state.item, {headers: this.state.apiHeader})
.then(res => {
if (!_.isEmpty(res.data)) {
Expand Down Expand Up @@ -201,7 +198,7 @@ export class TargetedPublishing extends React.Component {

if (this.state.newSite.id) {
newRuleForm = (
<NewDestination
<NewDestination
key={this.state.newSite.id}
site={this.state.newSite}
apiHeader={this.state.apiHeader}
Expand Down
10 changes: 10 additions & 0 deletions client/extensions/targetedPublishing/Tenant.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ export default class Tenant extends Component {
this.getRoutes();
}

componentWillReceiveProps(nextProps) {
if (nextProps.rule) {
const rule = nextProps.rule;
this.setState({
rule: rule,
newRule: rule
});
}
}

getRoutes() {
return axios.get(this.state.apiUrl + 'content/routes/', {headers: this.state.apiHeader, params: {limit: 1000, type: 'collection'}})
.then(res => {
Expand Down

0 comments on commit ffe9475

Please sign in to comment.