fix(platforms): add podcast id when deleting platforms on save

this prevents deleting other podcasts' platforms
This commit is contained in:
Yassine Doghri 2025-02-24 11:47:16 +00:00
parent 44ad651176
commit 019fbaf74d

View File

@ -135,12 +135,10 @@ class PlatformModel extends Model
{
$this->clearCache($podcastId);
$platforms = service('platforms');
$platformsData = $platforms->getPlatformsByType($platformType);
// delete all platforms given the type to overwrite them with data
$this->builder()
->whereIn('slug', array_keys($platformsData))
->where('podcast_id', $podcastId)
->where('type', $platformType)
->delete();
if ($data === []) {