Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Update patch attributes request with patchViewAttributes() in DataLay…
Browse files Browse the repository at this point in the history
…erWrapper #1357

(cherry picked from commit 9c5caa4)
  • Loading branch information
wiadev authored and metas-ts committed Dec 4, 2017
1 parent 71dfd16 commit bc6e052
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/components/DataLayoutWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component, cloneElement } from 'react';
import {connect} from 'react-redux';

import {
patchRequest
patchViewAttributes
} from '../actions/GenericActions';

import {
Expand Down Expand Up @@ -39,17 +39,16 @@ class DataLayoutWrapper extends Component {
}

handlePatch = (prop, value, cb) => {
const {entity, windowType, viewId} = this.props;
const {dataId} = this.state;

patchRequest({
entity,
docType: windowType,
docId: dataId,
property: prop,
value,
viewId
}).then(response => {
const {windowType : windowId, viewId} = this.props;
const {dataId : rowId} = this.state;

patchViewAttributes(
windowId,
viewId,
rowId,
prop,
value
).then(response => {
const preparedData = parseToDisplay(response.data[0].fieldsByName);
preparedData && Object.keys(preparedData).map(key => {
this.setState(prevState => ({
Expand Down

0 comments on commit bc6e052

Please sign in to comment.