diff src/add_post.js.luan @ 16:82b55186a4a0

fix delete_chat
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 03 Nov 2024 21:22:06 -0700
parents 8b8905f63d80
children f4708943f29e
line wrap: on
line diff
--- a/src/add_post.js.luan	Sun Nov 03 17:36:49 2024 -0700
+++ b/src/add_post.js.luan	Sun Nov 03 21:22:06 2024 -0700
@@ -17,8 +17,7 @@
 local new_post = Post.new or error()
 local Shared = require "site:/lib/Shared.luan"
 local post_html = Shared.post_html or error()
-local Utils = require "site:/lib/Utils.luan"
-local base_url = Utils.base_url or error()
+local http_push_to_users = Shared.http_push_to_users or error()
 
 
 return function()
@@ -43,9 +42,5 @@
 	local js = "added("..json_string(html)..")"
 	chat.http_push(js)
 	js = "getChats('"..chat.id.."')"
-	local base = base_url().."/user/"
-	for _, user_id in ipairs(chat.user_ids) do
-		local url = base..user_id
-		Http.push(url,js)
-	end
+	http_push_to_users( chat.user_ids, js )
 end