Scan to open on your phone
Point a camera at the QR code - it opens this exact paste, no app needed.
https://codepastes.com/zzgs3ap4ytax1z93untitledPlain Text
onGuardar = { nombre, tipo, aroma ->
scope.launch {
try {
val nuevoProductoId = UUID.randomUUID().toString()
val nuevoProducto = ProductoEntity(
id = nuevoProductoId,
nombre = nombre,
tipo = tipo
)
val nuevoAroma = AromaEntity(
id = UUID.randomUUID().toString(),
productoId = nuevoProductoId,
nombre = aroma
)
productoDao.crearProductoConSincronizacion(
producto = nuevoProducto,
usuarioId = idUsuario
)
SincronizacionScheduler.programar(context)
productoDao.crearAromaConSincronizacion(
aroma = nuevoAroma,
usuarioId = idUsuario
)
SincronizacionScheduler.programar(context)
mostrarFormularioProducto = false
} catch (e: Exception) {
mensajeAroma = e.message
?: "No se pudo guardar el producto."
}
}
}2,150 chars · codepastes.com