feat(episodes): replace soft delete with permanent delete

+ add constraint to prevent deleting an episode when published
This commit is contained in:
Ola Hneini 2022-05-05 15:48:16 +00:00 committed by Yassine Doghri
commit eb9ff522c2
20 changed files with 242 additions and 107 deletions

View file

@ -63,12 +63,16 @@ class Transcript extends BaseMedia
return $this;
}
public function deleteFile(): void
public function deleteFile(): bool
{
parent::deleteFile();
if (! parent::deleteFile()) {
return false;
}
if ($this->json_path) {
unlink($this->json_path);
return unlink($this->json_path);
}
return true;
}
}