From 019fbaf74ddd7427c3b7dfaef0d2e4409aab0e7c Mon Sep 17 00:00:00 2001 From: Yassine Doghri Date: Mon, 24 Feb 2025 11:47:16 +0000 Subject: [PATCH] fix(platforms): add podcast id when deleting platforms on save this prevents deleting other podcasts' platforms --- modules/Platforms/Models/PlatformModel.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/Platforms/Models/PlatformModel.php b/modules/Platforms/Models/PlatformModel.php index 634255c6..c4d820eb 100644 --- a/modules/Platforms/Models/PlatformModel.php +++ b/modules/Platforms/Models/PlatformModel.php @@ -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 === []) {