Make Telegram chat_id per-company, bot token stays global
Each company can now have its own Telegram channel/group for alerts. - Bot token: global (superadmin only, shared across companies) - Chat ID: per-company (stored in integrations table config) - sendTelegramAlert reads chat_id from company integration - Test message shows company name - Non-superadmin users can't see/edit bot token Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2738,6 +2738,9 @@ async function loadSettings() {
|
||||
// Telegram-asetukset
|
||||
document.getElementById('settings-telegram-token').value = config.telegram_bot_token || '';
|
||||
document.getElementById('settings-telegram-chat').value = config.telegram_chat_id || '';
|
||||
// Bot Token vain superadminille
|
||||
const tokenGroup = document.getElementById('telegram-token-group');
|
||||
if (tokenGroup) tokenGroup.style.display = currentUser?.role === 'superadmin' ? '' : 'none';
|
||||
} catch (e) { console.error(e); }
|
||||
|
||||
// Lataa saatavuuskyselyt
|
||||
|
||||
Reference in New Issue
Block a user