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

Commit

Permalink
hotfix #1357
Browse files Browse the repository at this point in the history
(cherry picked from commit 43e0828)

solved Conflicts:
	src/actions/GenericActions.js
  • Loading branch information
wiadev authored and metas-ts committed Dec 4, 2017
1 parent bc6e052 commit 09dde4a
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/actions/GenericActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,43 @@ export function getViewAttributes (
);
}

function getPatchRequestPayload(property, value) {
let payload = [];
if (Array.isArray(property) && value !== undefined) {
payload = property.map(item => ({
op: 'replace',
path: item.field,
value
}));
} else if (property && value !== undefined) {
payload = [{
op: 'replace',
path: property,
value
}];
}

return payload;
}

export function patchViewAttributes(
windowId,
viewId,
rowId,
property,
value
) {
const payload = getPatchRequestPayload(property, value);

return axios.patch(
config.API_URL +
'/documentView'+
'/' + windowId +
'/' + viewId +
'/' + rowId +
'/attributes', payload);
}

export function createInstance(entity, docType, docId, tabId, subentity) {
return axios.post(
config.API_URL +
Expand Down

0 comments on commit 09dde4a

Please sign in to comment.