Skip to content

Commit

Permalink
restore thumbnail save (#685)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Dec 21, 2021
1 parent 5085b9b commit 5dcdd26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion geonode_mapstore_client/client/js/epics/gnsave.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ import {
getResourceData,
getResourceId,
getDataPayload,
getCompactPermissions
getCompactPermissions,
getResourceThumbnail
} from '@js/selectors/resource';

import {
Expand Down Expand Up @@ -128,6 +129,7 @@ export const gnSaveContent = (action$, store) =>
const data = getDataPayload(state, contentType);
const body = {
'title': action.metadata.name,
...(action.metadata.thumbnail && { 'thumbnail_url': action.metadata.thumbnail }),
...(action.metadata.description && { 'abstract': action.metadata.description }),
...(data && { 'data': JSON.parse(JSON.stringify(data)) })
};
Expand Down Expand Up @@ -226,9 +228,11 @@ export const gnSaveDirectContent = (action$, store) =>
const geoLimitsErrors = geoLimitsResponses.filter(({ error }) => error);
const name = getResourceName(state);
const description = getResourceDescription(state);
const thumbnail = getResourceThumbnail(state);
const metadata = {
name: (name) ? name : resource?.title,
description: (description) ? description : resource?.abstract,
...(thumbnail && { thumbnail }),
extension: resource?.extension,
href: resource?.href
};
Expand Down

0 comments on commit 5dcdd26

Please sign in to comment.