comparison src/lib/Post.luan @ 79:b5a316575e64

reply
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 10 Mar 2025 21:41:53 -0600
parents 9298b04607ae
children
comparison
equal deleted inserted replaced
78:2a602ef53eef 79:b5a316575e64
15 id = doc.id 15 id = doc.id
16 chat_id = doc.post_chat_id 16 chat_id = doc.post_chat_id
17 author_id = doc.author_id 17 author_id = doc.author_id
18 date = doc.post_date 18 date = doc.post_date
19 content = doc.content 19 content = doc.content
20 reply = doc.reply
20 } 21 }
21 end 22 end
22 23
23 local function to_doc(post) 24 local function to_doc(post)
24 return { 25 return {
26 id = post.id 27 id = post.id
27 post_chat_id = long(post.chat_id) 28 post_chat_id = long(post.chat_id)
28 author_id = long(post.author_id) 29 author_id = long(post.author_id)
29 post_date = long(post.date) 30 post_date = long(post.date)
30 content = post.content or error() 31 content = post.content or error()
32 reply = post.reply and long(post.reply)
31 } 33 }
32 end 34 end
33 35
34 function Post.new(post) 36 function Post.new(post)
35 function post.save() 37 function post.save()