basic working

This commit is contained in:
Will Bradley
2025-10-11 21:05:39 -07:00
parent 4767b67460
commit d19c071814
8 changed files with 57 additions and 25 deletions
+4 -4
View File
@@ -173,10 +173,10 @@ const api = {
return this.request(`/api/messages?limit=${limit}`);
},
async sendMessage(text, channel = 0) {
async sendMessage(from, text) {
return this.request('/api/messages/send', {
method: 'POST',
body: JSON.stringify({ text, channel })
body: JSON.stringify({ text, from })
});
},
@@ -546,10 +546,10 @@ document.getElementById('send-message-form')?.addEventListener('submit', async (
e.preventDefault();
const text = document.getElementById('message-text').value;
const channel = parseInt(document.getElementById('message-channel').value);
const from = parseInt(document.getElementById('message-from').value);
try {
await api.sendMessage(text, channel);
await api.sendMessage(text, from);
document.getElementById('message-text').value = '';
// Reload messages after a short delay