Skip to content

Commit

Permalink
Fix #716
Browse files Browse the repository at this point in the history
  • Loading branch information
srosset81 committed Jan 24, 2025
1 parent 14dc367 commit 919324e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/frontend/packages/semantic-data-provider/dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/frontend/packages/semantic-data-provider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"jsonld": "^5.2.0",
"jwt-decode": "^3.0.0",
"sparqljs": "^3.5.1",
"speakingurl": "^14.0.1",
"url-join": "^4.0.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import urlJoin from 'url-join';
import createSlug from 'speakingurl';
import getOne from './getOne';
import handleFiles from '../utils/handleFiles';
import findContainersWithTypes from '../utils/findContainersWithTypes';
Expand Down Expand Up @@ -35,11 +36,12 @@ const createMethod = config => async (resourceId, params) => {

if (params.data) {
if (dataModel.fieldsMapping?.title) {
if (Array.isArray(dataModel.fieldsMapping.title)) {
headers.set('Slug', dataModel.fieldsMapping.title.map(f => params.data[f]).join(' '));
} else {
headers.set('Slug', params.data[dataModel.fieldsMapping.title]);
}
const slug = Array.isArray(dataModel.fieldsMapping.title)
? dataModel.fieldsMapping.title.map(f => params.data[f]).join(' ')
: params.data[dataModel.fieldsMapping.title];

// Generate slug here, otherwise we may get errors with special characters
headers.set('Slug', createSlug(slug));
}

// Upload files, if there are any
Expand Down

0 comments on commit 919324e

Please sign in to comment.