Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
fix content.js customization
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Jan 11, 2022
1 parent 331be35 commit 0f16a6a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/customizations/volto/actions/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,25 @@ export function deleteContent(urls) {
* @function updateContent
* @param {string|Array} urls Content url(s).
* @param {Object|Array} content Content data.
* @param {Object|Array} headers Custom headers.
* @returns {Object} Update content action.
*/
export function updateContent(urls, content) {
export function updateContent(urls, content, headers = {}) {
return {
type: UPDATE_CONTENT,
request:
typeof urls === 'string'
? { op: 'patch', path: urls, data: nestContent(content) }
? {
op: 'patch',
path: urls,
data: nestContent(content),
headers: headers,
}
: urls.map((url, index) => ({
op: 'patch',
path: url,
data: nestContent(content[index]),
headers: headers,
})),
};
}
Expand Down

0 comments on commit 0f16a6a

Please sign in to comment.