bug fix: The change in document library selection was not reflected in the FileUpload component. This has been fixed by making sure the eventhandlers on dropzone component used the parent FileUpload component property for listname (#653)

This commit is contained in:
Shreyas Ganta 2018-11-09 08:57:58 -06:00 committed by Vesa Juvonen
parent 7ba57edbc8
commit c9cb5ae48d
1 changed files with 3 additions and 3 deletions

View File

@ -46,11 +46,11 @@ export default class FileUpload extends React.Component<IFileUploadProps, {}> {
processing: function (file, xhr) { processing: function (file, xhr) {
if(_fileUploadTo=="DocumentLibrary") if(_fileUploadTo=="DocumentLibrary")
myDropzone.options.url = `${_context.pageContext.web.absoluteUrl}/_api/web/Lists/getById('${_listName}')/rootfolder/files/add(overwrite=true,url='${file.name}')`; myDropzone.options.url = `${_context.pageContext.web.absoluteUrl}/_api/web/Lists/getById('${_parent.props.listName}')/rootfolder/files/add(overwrite=true,url='${file.name}')`;
else else
{ {
if(_itemId) if(_itemId)
myDropzone.options.url = `${_context.pageContext.web.absoluteUrl}/_api/web/lists/getById('${_listName}')/items(${_itemId})/AttachmentFiles/add(FileName='${file.name}')`; myDropzone.options.url = `${_context.pageContext.web.absoluteUrl}/_api/web/lists/getById('${_parent.props.listName}')/items(${_itemId})/AttachmentFiles/add(FileName='${file.name}')`;
else else
alert('Item not found or query string value is null!') alert('Item not found or query string value is null!')
} }