|
|
@ -28,11 +28,13 @@ impl TagDao {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect();
|
|
|
|
.collect();
|
|
|
|
|
|
|
|
|
|
|
|
content_descriptor_tag::Entity::insert_many(active_models)
|
|
|
|
if !active_models.is_empty() {
|
|
|
|
.exec(&trx)
|
|
|
|
content_descriptor_tag::Entity::insert_many(active_models)
|
|
|
|
.await?;
|
|
|
|
.exec(&trx)
|
|
|
|
|
|
|
|
.await?;
|
|
|
|
|
|
|
|
|
|
|
|
trx.commit().await?;
|
|
|
|
trx.commit().await?;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -60,7 +62,7 @@ async fn get_existing_mappings(
|
|
|
|
.all(trx)
|
|
|
|
.all(trx)
|
|
|
|
.await?
|
|
|
|
.await?
|
|
|
|
.into_iter()
|
|
|
|
.into_iter()
|
|
|
|
.map(|model: content_descriptor_tag::Model| (model.tag_id, model.cd_id))
|
|
|
|
.map(|model: content_descriptor_tag::Model| (model.cd_id, model.tag_id))
|
|
|
|
.collect();
|
|
|
|
.collect();
|
|
|
|
Ok(existing_mappings)
|
|
|
|
Ok(existing_mappings)
|
|
|
|
}
|
|
|
|
}
|
|
|
|