Skip to content
Snippets Groups Projects
Commit 7d313fed authored by Mike Lynch's avatar Mike Lynch
Browse files

Merge branch 'stash-pub-mvp'

eresearch/rdm#1142 - publish urls
parents 7d8cc672 aee7407d
Branches
Tags
No related merge requests found
......@@ -383,18 +383,28 @@ function make_files(datapub) {
return [];
}
const files = datapub['dataLocations'].map((dl) => {
if( dl['type'] == 'attachment' && dl['selected'] ) {
return {
'@id': dl['path'],
'path': dl['path'],
'name': dl['name'],
'@type': 'File',
'description': dl['notes'],
'contentSize': dl['contentSize'],
'encodingFormat': dl['mimeType']
if( dl['selected'] ) {
if( dl['type'] === 'attachment' ) {
return {
'@id': dl['path'],
'path': dl['path'],
'name': dl['name'],
'@type': 'File',
'description': dl['notes'],
'contentSize': dl['contentSize'],
'encodingFormat': dl['mimeType']
}
}
} else {
// todo: URLs and physical locations
if( dl['type'] === 'url' ) {
return {
'@id': dl['url'],
'name': dl['url'],
'@type': 'WebSite',
'description': dl['notes'],
'url': dl['url']
}
}
// physical locations or file paths don't get anything
return undefined;
}
});
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment