This commit is contained in:
parent
e564f1328b
commit
5f37856927
@ -1941,9 +1941,11 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
|
||||
flag_no_active_voucher, _ := h.flagManager.GetFlag("flag_no_active_voucher")
|
||||
|
||||
// check if the user has an active sym
|
||||
_, err = userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
|
||||
activeSym, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_SYM)
|
||||
|
||||
if err != nil {
|
||||
logg.InfoCtxf(ctx, "Checking the data as no", "DATA_ACTIVE_SYM", storedb.DATA_ACTIVE_SYM)
|
||||
|
||||
if db.IsNotFound(err) {
|
||||
publicKey, err := userStore.ReadEntry(ctx, sessionId, storedb.DATA_PUBLIC_KEY)
|
||||
if err != nil {
|
||||
@ -1958,6 +1960,8 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
|
||||
return res, nil
|
||||
}
|
||||
|
||||
logg.InfoCtxf(ctx, "fetched user vouchers in SetDefaultVoucher", "public_key", string(publicKey), "vouchers", vouchersResp)
|
||||
|
||||
// Return if there is no voucher
|
||||
if len(vouchersResp) == 0 {
|
||||
res.FlagSet = append(res.FlagSet, flag_no_active_voucher)
|
||||
@ -2007,6 +2011,8 @@ func (h *MenuHandlers) SetDefaultVoucher(ctx context.Context, sym string, input
|
||||
return res, err
|
||||
}
|
||||
|
||||
logg.InfoCtxf(ctx, "The activeSym:", "activeSym", string(activeSym))
|
||||
|
||||
res.FlagReset = append(res.FlagReset, flag_no_active_voucher)
|
||||
|
||||
return res, nil
|
||||
|
Loading…
Reference in New Issue
Block a user