view src/edit_post.js.luan @ 54:1d724f187cff

minor fix
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 03 Mar 2025 21:19:12 -0700
parents af41be2dcdec
children
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local Parsers = require "luan:Parsers.luan"
local json_string = Parsers.json_string or error()
local Io = require "luan:Io.luan"
local Http = require "luan:http/Http.luan"
local Post = require "site:/lib/Post.luan"
local get_post_by_id = Post.get_by_id or error()


return function()
	local post = Http.request.parameters.post or error()
	post = get_post_by_id(post) or error()
	Io.stdout = Http.response.text_writer()
%>
	openEditPost('<%=post.id%>',<%=json_string(post.content)%>);
<%
end