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:
parent
7ba57edbc8
commit
c9cb5ae48d
|
@ -46,11 +46,11 @@ export default class FileUpload extends React.Component<IFileUploadProps, {}> {
|
|||
processing: function (file, xhr) {
|
||||
|
||||
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
|
||||
{
|
||||
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
|
||||
alert('Item not found or query string value is null!')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue