comparison src/save_chat.js.luan @ 31:1e7d855afde3

voices
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 03 Aug 2025 17:05:38 -0600
parents 505185272dd7
children d34d709a7a8e
comparison
equal deleted inserted replaced
30:d48f48e1b790 31:1e7d855afde3
13 13
14 14
15 return function() 15 return function()
16 local chat = Http.request.parameters.chat or error() 16 local chat = Http.request.parameters.chat or error()
17 local name = Http.request.parameters.name or error() 17 local name = Http.request.parameters.name or error()
18 local voice = Http.request.parameters.voice or error()
18 run_in_transaction( function() 19 run_in_transaction( function()
19 chat = get_chat_by_id(chat) or error() 20 chat = get_chat_by_id(chat) or error()
20 chat.user_id == current_user().id or error() 21 chat.user_id == current_user().id or error()
21 chat.name = name 22 chat.name = name
23 chat.voice = voice
22 chat.save() 24 chat.save()
23 end ) 25 end )
24 Io.stdout = Http.response.text_writer() 26 Io.stdout = Http.response.text_writer()
25 %> 27 %>
26 setChat(<%= json_string(chat.info()) %>); 28 setChat(<%= json_string(chat.info()) %>);