chore: build
ci-api / test (push) Failing after 8m7s
ci-web / test (push) Failing after 5m5s

This commit is contained in:
Xor290
2026-09-20 12:18:33 +02:00
parent 8f4c7fa47a
commit 919c807004
174 changed files with 9669 additions and 1308 deletions
+5 -10
View File
@@ -23,13 +23,12 @@ func (s *Service) Get(ctx context.Context) (*Settings, error) {
// Update persists the settings. botToken == "" means "leave the currently
// stored token untouched" -- the admin never has to re-type the secret just
// to flip a checkbox, and the API never has to echo it back.
func (s *Service) Update(ctx context.Context, enabled bool, botToken, chatID string, notifyNewOrder, notifyStatusChange bool) (*Settings, error) {
func (s *Service) Update(ctx context.Context, enabled bool, botToken, chatID string, notifyNewOrder bool) (*Settings, error) {
settings := &Settings{
Enabled: enabled,
BotToken: botToken,
ChatID: chatID,
NotifyNewOrder: notifyNewOrder,
NotifyStatusChange: notifyStatusChange,
Enabled: enabled,
BotToken: botToken,
ChatID: chatID,
NotifyNewOrder: notifyNewOrder,
}
if err := s.repo.Update(ctx, settings); err != nil {
return nil, err
@@ -56,10 +55,6 @@ func (s *Service) NotifyNewOrder(ctx context.Context, summary string) {
s.notify(ctx, func(st *Settings) bool { return st.NotifyNewOrder }, summary)
}
func (s *Service) NotifyOrderStatusChange(ctx context.Context, summary string) {
s.notify(ctx, func(st *Settings) bool { return st.NotifyStatusChange }, summary)
}
func (s *Service) notify(ctx context.Context, shouldSend func(*Settings) bool, text string) {
settings, err := s.repo.Get(ctx)
if err != nil {