diff src/save_edit.js.luan @ 16:bff178656073

delete function
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 06 Jul 2022 22:42:42 -0600
parents 0edde02b908c
children da006d1c1eba
line wrap: on
line diff
--- a/src/save_edit.js.luan	Tue Jul 05 23:27:54 2022 -0600
+++ b/src/save_edit.js.luan	Wed Jul 06 22:42:42 2022 -0600
@@ -10,7 +10,6 @@
 local bbcode_preprocess = Bbcode.preprocess or error()
 local bbcode_to_html = Bbcode.to_html or error()
 local Db = require "site:/lib/Db.luan"
-local User = require "site:/lib/User.luan"
 
 
 return function()
@@ -19,8 +18,7 @@
 	text = bbcode_preprocess(text)
 	Db.run_in_transaction( function()
 		post = Post.get_by_id(post) or error()
-		local user = User.current() or error()
-		user.name = post.author_name or error()
+		post.author_is_current() or error()
 		post.content = text
 		post.save()
 	end )