Mercurial Hosting > luan
view examples/blog/src/delete.luan @ 1700:47302bc83b2e
use local luan
author | Vadim Filimonov <fffilimonov@yandex.ru> |
---|---|
date | Tue, 28 Jun 2022 17:49:27 +0300 |
parents | bc40bc9aab3a |
children |
line wrap: on
line source
local Luan = require "luan:Luan.luan" local error = Luan.error local String = require "luan:String.luan" local to_number = String.to_number or error() local Http = require "luan:http/Http.luan" local Post = require "site:/lib/Post.luan" return function() local post_id = to_number(Http.request.parameters.post) or error() Post.delete_by_id(post_id) Http.response.send_redirect("/") end