From 5cf3e10974214fad0cd6a337ee2e41d7c4a34176 Mon Sep 17 00:00:00 2001 From: Hugo Vieilledent Date: Thu, 31 Jan 2019 21:57:40 +0100 Subject: [PATCH] fix unable to add new favorite because one listed no longer exists --- database.rules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.rules.json b/database.rules.json index 525a3a4..efc9bab 100644 --- a/database.rules.json +++ b/database.rules.json @@ -135,7 +135,7 @@ }, "favoriteChannels": { "$favoriteChannel": { - ".validate": "root.child('channels').child($favoriteChannel).exists()" + ".validate": "root.child('channels').child($favoriteChannel).exists() || root.child('channels').child($channelID).child('favoriteChannels').child($favoriteChannel).exists() && !newData.child($favoriteChannel).exists()" } }, "image": {