This commit is contained in:
parent
d504571014
commit
e681c9cfca
@ -1931,7 +1931,6 @@ func (h *MenuHandlers) InitiateTransaction(ctx context.Context, sym string, inpu
|
|||||||
// and sets the first as the default voucher, if no active voucher is set.
|
// and sets the first as the default voucher, if no active voucher is set.
|
||||||
func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
var err error
|
|
||||||
userStore := h.userdataStore
|
userStore := h.userdataStore
|
||||||
|
|
||||||
sessionId, ok := ctx.Value("SessionId").(string)
|
sessionId, ok := ctx.Value("SessionId").(string)
|
||||||
@ -1943,8 +1942,9 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
|
|||||||
|
|
||||||
// check if the user has an active sym
|
// check if the user has an active sym
|
||||||
activeSym, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
|
activeSym, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
|
||||||
|
logg.InfoCtxf(ctx, "The activeSym in SetDefaultVoucher:", "activeSym", string(activeSym))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
logg.ErrorCtxf(ctx, "The err", err)
|
||||||
logg.InfoCtxf(ctx, "Checking the data as no activeSym", "DATA_ACTIVE_SYM", storedb.DATA_ACTIVE_SYM)
|
logg.InfoCtxf(ctx, "Checking the data as no activeSym", "DATA_ACTIVE_SYM", storedb.DATA_ACTIVE_SYM)
|
||||||
|
|
||||||
if db.IsNotFound(err) {
|
if db.IsNotFound(err) {
|
||||||
@ -2016,8 +2016,6 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
|
|||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
|
||||||
logg.InfoCtxf(ctx, "The activeSym in SetDefaultVoucher:", "activeSym", string(activeSym))
|
|
||||||
|
|
||||||
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
|
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
|
@ -33,11 +33,14 @@ func (s *SubPrefixDb) toKey(k []byte) []byte {
|
|||||||
func (s *SubPrefixDb) Get(ctx context.Context, key []byte) ([]byte, error) {
|
func (s *SubPrefixDb) Get(ctx context.Context, key []byte) ([]byte, error) {
|
||||||
s.store.SetPrefix(db.DATATYPE_USERDATA)
|
s.store.SetPrefix(db.DATATYPE_USERDATA)
|
||||||
key = s.toKey(key)
|
key = s.toKey(key)
|
||||||
|
logg.InfoCtxf(ctx, "SubPrefixDb Get log", "key", string(key))
|
||||||
|
|
||||||
return s.store.Get(ctx, key)
|
return s.store.Get(ctx, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SubPrefixDb) Put(ctx context.Context, key []byte, val []byte) error {
|
func (s *SubPrefixDb) Put(ctx context.Context, key []byte, val []byte) error {
|
||||||
s.store.SetPrefix(db.DATATYPE_USERDATA)
|
s.store.SetPrefix(db.DATATYPE_USERDATA)
|
||||||
key = s.toKey(key)
|
key = s.toKey(key)
|
||||||
|
logg.InfoCtxf(ctx, "SubPrefixDb Put log", "key", string(key))
|
||||||
return s.store.Put(ctx, key, val)
|
return s.store.Put(ctx, key, val)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user