view src/added.js.luan @ 66:f067de76084c

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 06 Mar 2025 03:09:24 -0700
parents 1d724f187cff
children
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local Http = require "luan:http/Http.luan"
local User = require "site:/lib/User.luan"
local current_user = User.current or error()
local Chat = require "site:/lib/Chat.luan"
local get_chat_by_id = Chat.get_by_id or error()


return function()
	local user = current_user() or error()
	local chat = Http.request.parameters.chat or error()
	chat = get_chat_by_id(chat) or error()
	chat.read(user)
end