fix: apollo server image upload

This commit is contained in:
José Oliveira 2021-11-03 20:56:26 +00:00
parent 9baa16c824
commit 3e4f4a4962
6 changed files with 103 additions and 10 deletions

View file

@ -60,6 +60,7 @@ const Photo = ({ show, src }) => {
const CustomerData = ({
customer,
updateCustomer,
replacePhoto,
editCustomer,
deleteEditedData
}) => {
@ -230,7 +231,11 @@ const CustomerData = ({
authorize: () =>
updateCustomer({ frontCameraOverride: OVERRIDE_AUTHORIZED }),
reject: () => updateCustomer({ frontCameraOverride: OVERRIDE_REJECTED }),
save: values => editCustomer({ frontCamera: values.frontCamera }),
save: values =>
replacePhoto({
newPhoto: values.frontCamera,
photoType: 'frontCamera'
}),
deleteEditedData: () => deleteEditedData({ frontCamera: null }),
children: customer.frontCameraPath ? (
<Photo
@ -252,7 +257,11 @@ const CustomerData = ({
authorize: () =>
updateCustomer({ idCardPhotoOverride: OVERRIDE_AUTHORIZED }),
reject: () => updateCustomer({ idCardPhotoOverride: OVERRIDE_REJECTED }),
save: values => editCustomer({ idCardPhoto: values.idCardPhoto }),
save: values =>
replacePhoto({
newPhoto: values.idCardPhoto,
photoType: 'idCardPhoto'
}),
deleteEditedData: () => deleteEditedData({ idCardPhoto: null }),
children: customer.idCardPhotoPath ? (
<Photo