Mercurial Hosting > chat
view src/save_voice.js.luan @ 54:1d724f187cff
minor fix
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 03 Mar 2025 21:19:12 -0700 |
parents | 818697418dbe |
children |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local Http = require "luan:http/Http.luan" local Db = require "site:/lib/Db.luan" local run_in_transaction = Db.run_in_transaction or error() local User = require "site:/lib/User.luan" local current_user = User.current or error() return function() local url = Http.request.parameters.url or error() if url == "" then url = nil end run_in_transaction( function() local user = current_user() or error() user.voice_url = url user.save() end ) end