mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-23 18:42:01 +00:00
fix(platforms): add podcast id when deleting platforms on save
this prevents deleting other podcasts' platforms
This commit is contained in:
parent
44ad651176
commit
019fbaf74d
@ -135,12 +135,10 @@ class PlatformModel extends Model
|
|||||||
{
|
{
|
||||||
$this->clearCache($podcastId);
|
$this->clearCache($podcastId);
|
||||||
|
|
||||||
$platforms = service('platforms');
|
// delete all platforms given the type to overwrite them with data
|
||||||
|
|
||||||
$platformsData = $platforms->getPlatformsByType($platformType);
|
|
||||||
|
|
||||||
$this->builder()
|
$this->builder()
|
||||||
->whereIn('slug', array_keys($platformsData))
|
->where('podcast_id', $podcastId)
|
||||||
|
->where('type', $platformType)
|
||||||
->delete();
|
->delete();
|
||||||
|
|
||||||
if ($data === []) {
|
if ($data === []) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user