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

Commit

Permalink
Revamp getViewAttributes() method
Browse files Browse the repository at this point in the history
  • Loading branch information
wiadev committed Nov 30, 2017
1 parent 55a13af commit e0eed6c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
19 changes: 9 additions & 10 deletions src/actions/GenericActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,20 @@ export function getData(
}

/**
*
* @param {*} entity - entity should always be `documentView`
* @param {*} windowId
* @param {*} viewId
* @param {*} rowId
*
* @param {*} windowId
* @param {*} viewId
* @param {*} rowId
*/
export function getAttributes(
entity, windowId, viewId, rowId
export function getViewAttributes (
windowId, viewId, rowId
) {
return axios.get(
config.API_URL +
'/' + entity +
'/documentView'+
'/' + windowId +
(viewId ? '/' + viewId : '') +
(rowId ? '/' + rowId : '') +
'/' + viewId +
'/' + rowId +
'/attributes'
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/app/SelectionAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import counterpart from 'counterpart';

import {
initLayout,
getAttributes
getViewAttributes
} from '../../actions/GenericActions';

import RawWidget from '../widget/RawWidget';
Expand Down Expand Up @@ -41,7 +41,7 @@ class SelectionAttributes extends Component {
initLayout(entity, windowType, selected[0], null, viewId)
.then(response => {
DLWrapperSetLayout(response.data.elements);
return getAttributes(entity, windowType, viewId, selected[0]);
return getViewAttributes(windowType, viewId, selected[0]);
}).then(response => {
DLWrapperSetData(response.data.fieldsByName, response.data.id);
}).catch(() => {});
Expand Down

1 comment on commit e0eed6c

@metas-ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.