chore: build

This commit is contained in:
2026-06-12 11:13:47 +02:00
parent cc278ecef5
commit 20da2a560f
8 changed files with 174 additions and 16 deletions
+12
View File
@@ -154,6 +154,11 @@ func (d *Database) GetSettings() (models.AppSettings, error) {
settings.TelegramBotUsername = row.Value
case "telegram_notifications_enabled":
settings.TelegramNotificationsEnabled = row.Value == "true"
case "telegram_notif_bots":
var bots []models.TelegramBotConfig
if err := json.Unmarshal([]byte(row.Value), &bots); err == nil {
settings.TelegramNotifBots = bots
}
case "delivery_mode":
var mode models.DeliveryModeConfig
if err := json.Unmarshal([]byte(row.Value), &mode); err == nil {
@@ -249,6 +254,13 @@ func (d *Database) UpdateSettings(s models.AppSettings) error {
{"telegram_bot_token", s.TelegramBotToken},
{"telegram_bot_username", s.TelegramBotUsername},
{"telegram_notifications_enabled", boolStr(s.TelegramNotificationsEnabled)},
{"telegram_notif_bots", func() string {
if s.TelegramNotifBots == nil {
s.TelegramNotifBots = []models.TelegramBotConfig{}
}
b, _ := json.Marshal(s.TelegramNotifBots)
return string(b)
}()},
{"telegram_2fa_enabled", boolStr(s.Telegram2FAEnabled)},
{"delivery_mode", string(deliveryModeJSON)},
{"shop_name", s.ShopName},