fix(currency): initialize exchange rate to 0 and improve error logging in purchase checkout

This commit is contained in:
Chang lue Tsen
2026-01-07 09:35:52 -05:00
parent 58caa497c3
commit 7d84cf858b
3 changed files with 12 additions and 1 deletions
@@ -4,6 +4,7 @@ import (
"context"
"reflect"
"github.com/perfect-panel/server/initialize"
"github.com/perfect-panel/server/internal/config"
"github.com/perfect-panel/server/internal/model/system"
"github.com/perfect-panel/server/pkg/tool"
@@ -54,6 +55,7 @@ func (l *UpdateCurrencyConfigLogic) UpdateCurrencyConfig(req *types.CurrencyConf
// clear cache
return l.svcCtx.Redis.Del(l.ctx, config.CurrencyConfigKey, config.GlobalConfigKey).Err()
})
initialize.Currency(l.svcCtx)
if err != nil {
l.Errorw("[UpdateCurrencyConfig] update currency config error", logger.Field("error", err.Error()))
return errors.Wrapf(xerr.NewErrCode(xerr.DatabaseUpdateError), "update invite config error: %v", err)