change media delete format..

This commit is contained in:
Cüneyt Şentürk
2021-02-10 12:08:39 +03:00
parent eaab52328b
commit d82c251085
3 changed files with 36 additions and 5 deletions

View File

@ -37,7 +37,7 @@ class UpdateTransaction extends Job
// Upload attachment
if ($this->request->file('attachment')) {
$this->transaction->delete_attachment();
$this->deleteMediaModel($this->transaction, 'attachment', $this->request);
foreach ($this->request->file('attachment') as $attachment) {
$media = $this->getMedia($attachment, 'transactions');
@ -45,7 +45,7 @@ class UpdateTransaction extends Job
$this->transaction->attachMedia($media, 'attachment');
}
} elseif (!$this->request->file('attachment') && $this->transaction->attachment) {
$this->transaction->delete_attachment();
$this->deleteMediaModel($this->transaction, 'attachment', $this->request);
}
// Recurring