[ENG-1546] Delete tag_on_object entries before the tag itself (so tags can be deleted) (#1944)

fix: delete `tag_on_object` entries before the tag itself
This commit is contained in:
jake authored and GitHub committed 2024-01-16 17:58:30 +00:00
1 parent fdf31fc3a8
commit 073b96b29d
1 file changed
+7
+7
View File
@@ -358,6 +358,13 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
"delete",
R.with2(library())
.mutation(|(_, library), tag_id: i32| async move {
library
.db
.tag_on_object()
.delete_many(vec![tag_on_object::tag_id::equals(tag_id)])
.exec()
.await?;
library
.db
.tag()