untitled

Pasted Nov 17, 2026, 7:30 AM1 file36 lines

Scan to open on your phone

Point a camera at the QR code - it opens this exact paste, no app needed.

https://codepastes.com/zzgs38ayhp4sbnjw
untitled
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