Added RNFS and refactor image upload to use it
This commit is contained in:
@@ -53,9 +53,10 @@ export class BoundPhotoPanel extends Component {
|
||||
ImagePicker.showImagePicker(
|
||||
{
|
||||
title: "Select Photo",
|
||||
noData: true,
|
||||
storageOptions: {
|
||||
skipBackup: true,
|
||||
path: "photos",
|
||||
path: "deighton",
|
||||
},
|
||||
},
|
||||
(response) => {
|
||||
@@ -64,7 +65,7 @@ export class BoundPhotoPanel extends Component {
|
||||
onUploadStarted()
|
||||
}
|
||||
api
|
||||
.upload(response.data, this.props.onUploadProgress)
|
||||
.upload(response.path, this.props.onUploadProgress)
|
||||
.then((uploadData) => {
|
||||
if (onUploadEnded) {
|
||||
onUploadEnded(true, uploadData)
|
||||
@@ -74,7 +75,7 @@ export class BoundPhotoPanel extends Component {
|
||||
|
||||
if (binder) {
|
||||
const value = binder.getFieldValue(name)
|
||||
let newValue = value.slice(0)
|
||||
let newValue = typeof value === "array" ? value.slice(0) : []
|
||||
|
||||
newValue[index] = uploadData.assetId
|
||||
|
||||
|
||||
Reference in New Issue
Block a user