fix: add T&C photo to tx details

This commit is contained in:
José Oliveira 2022-03-09 12:35:37 +00:00
parent 348260931e
commit 13a16bc965
2 changed files with 22 additions and 14 deletions

View file

@ -49,6 +49,7 @@ const GET_TRANSACTIONS = gql`
customerIdCardData
customerIdCardPhotoPath
customerFrontCameraPath
txCustomerPhotoPath
customerPhone
discount
customerId

View file

@ -121,6 +121,8 @@ const DetailsRow = ({ it: tx, timezone }) => {
const isCashIn = tx.txClass === 'cashIn'
console.log(tx)
const zip = new JSZip()
const [fetchSummary] = useLazyQuery(TX_SUMMARY, {
@ -259,7 +261,8 @@ const DetailsRow = ({ it: tx, timezone }) => {
{tx.customerPhone}
</IDButton>
)}
{tx.customerIdCardPhotoPath && !tx.customerIdCardData && (
{(tx.customerIdCardPhotoPath || tx.txCustomerPhotoPath) &&
!tx.customerIdCardData && (
<IDButton
popoverClassname={classes.clipboardPopover}
className={classes.idButton}
@ -268,7 +271,11 @@ const DetailsRow = ({ it: tx, timezone }) => {
InverseIcon={CardIdInverseIcon}>
<img
className={classes.idCardPhoto}
src={`${URI}/id-card-photo/${tx.customerIdCardPhotoPath}`}
src={`${URI}${
tx.customerIdCardPhotoPath
? '/id-card-photo/'
: 'operator-data/customersphotos'
}${tx.customerIdCardPhotoPath ?? tx.txCustomerPhotoPath}`}
alt=""
/>
</IDButton>