Skip to content

Commit

Permalink
Document observer file fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnakamura committed May 17, 2022
1 parent 09b9618 commit f073ce6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Observers/Customer/DocumentObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public function created($customer)
$data = $customer->toArray();
$data['sync_to'] = 'sys';

//Passo o campo file novamente pois Document::getFileAttribute() gera uma url temporária de 5 minutos do S3
$data['file'] = $customer->getAttributes()['file'];

try {
$issSupernova = new IssSupernova();
$response = $issSupernova->customerDocuments()->create($data);
Expand All @@ -45,6 +48,9 @@ public function updated($customer)
$data = $customer->toArray();
$data['sync_to'] = 'sys';

//Passo o campo file novamente pois Document::getFileAttribute() gera uma url temporária de 5 minutos do S3
$data['file'] = $customer->getAttributes()['file'];

try {
$issSupernova = new IssSupernova();
$response = $issSupernova->customerDocuments()->update($data);
Expand Down

0 comments on commit f073ce6

Please sign in to comment.