diff src/delete_chat.js.luan @ 12:9f45d32670ae

server push
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 31 Oct 2024 21:40:57 -0600
parents 563a5358f2ee
children 82b55186a4a0
line wrap: on
line diff
--- a/src/delete_chat.js.luan	Thu Oct 31 19:17:53 2024 -0600
+++ b/src/delete_chat.js.luan	Thu Oct 31 21:40:57 2024 -0600
@@ -1,6 +1,5 @@
 local Luan = require "luan:Luan.luan"
 local error = Luan.error
-local Io = require "luan:Io.luan"
 local Http = require "luan:http/Http.luan"
 local User = require "site:/lib/User.luan"
 local current_user = User.current or error()
@@ -13,8 +12,5 @@
 	chat = get_chat_by_id(chat) or error()
 	local user = current_user() or error()
 	chat.delete()
-	Io.stdout = Http.response.text_writer()
-%>
-	location = '/chat.html';
-<%
+	chat.http_push("location = '/chat.html'")
 end