Skip to content

Commit

Permalink
[Fixes #1084] Use raw JSON body instead of ulencoded form for permiss…
Browse files Browse the repository at this point in the history
…ions PUT (#1086)
  • Loading branch information
DavidQuartz authored and giohappy committed Jul 12, 2022
1 parent 99b14b3 commit 81ffaed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions geonode_mapstore_client/client/js/api/geonode/v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,11 @@ export const getCompactPermissionsByPk = (pk) => {
};

export const updateCompactPermissionsByPk = (pk, body) => {
return axios.put(parseDevHostname(`${endpoints[RESOURCES]}/${pk}/permissions`), 'permissions=' + JSON.stringify(body))
return axios({
url: parseDevHostname(`${endpoints[RESOURCES]}/${pk}/permissions`),
data: body,
method: 'put'
})
.then(({ data }) => data);
};

Expand All @@ -751,7 +755,7 @@ export const downloadResource = (resource) => {
return axios.get(url, {
responseType: 'blob',
headers: {
'Content_type': 'application/json'
'Content-Type': 'application/json'
}
})
.then(({ data, headers }) => ({output: data, headers}));
Expand Down

0 comments on commit 81ffaed

Please sign in to comment.