[fleet] reimplement AiAuthError with the new rhizome api

GitOrigin-RevId: 59b80145b772a76b296367c1dcf50fd9a5ce297b
This commit is contained in:
Alexander Zolotov
2024-10-07 15:34:54 +02:00
committed by intellij-monorepo-bot
parent 15d2581c24
commit f2b03dbb7e

View File

@@ -70,15 +70,6 @@ fun ChangeScope.cascadeDelete(parent: Entity, child: Entity?) {
}
}
fun <T : LegacyEntity> ChangeScope.newOrMutateSingleton(c: KClass<T>, initMutate: T.() -> Unit): T {
val res = byEntityType(c)
return when {
res.isEmpty() -> new(c, defaultPart, initMutate)
res.size == 1 -> res.single().apply(initMutate)
else -> error("entity of type $c is not single: $res")
}
}
suspend inline fun <reified E : LegacyEntity, R : Any> getOrCreate(property: KMutableProperty1<E, R>,
value: R,