Compare commits

..

No commits in common. "560714838f20dbbd6726312fe5a8e226cb8a44f8" and "337419c9f24ca7b57fdd26f50f1612d51cd51b5f" have entirely different histories.

2 changed files with 21 additions and 2 deletions

View File

@ -140,12 +140,25 @@ func (h *Handlers) SetLanguage(ctx context.Context, sym string, input []byte) (r
// sets the default values and flags
func (h *Handlers) CreateAccount(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{}
// Preload the required flags
flagKeys := []string{"flag_account_created", "flag_account_creation_failed"}
flags, err := h.PreloadFlags(flagKeys)
if err != nil {
return res, err
}
// err = h.accountFileHandler.EnsureFileExists()
// if err != nil {
// return res, err
// }
// if an account exists, return to prevent duplicate account creation
// existingAccountData, err := h.accountFileHandler.ReadAccountData()
// if existingAccountData != nil {
// return res, err
// }
accountResp, err := h.accountService.CreateAccount()
if err != nil {
res.FlagSet = append(res.FlagSet, flags["flag_account_creation_failed"])
@ -480,6 +493,12 @@ func (h *Handlers) CheckAccountStatus(ctx context.Context, sym string, input []b
res.FlagReset = append(res.FlagSet, flags["flag_account_success"])
res.FlagSet = append(res.FlagReset, flags["flag_account_pending"])
}
// err = h.accountFileHandler.WriteAccountData(accountData)
// if err != nil {
// return res, err
// }
return res, nil
}
@ -832,7 +851,7 @@ func (h *Handlers) InitiateTransaction(ctx context.Context, sym string, input []
return res, nil
}
// GetProfileInfo retrieves and formats the profile information of a user from a Gdbm backed storage.
// GetProfileInfo retrieves and formats the profile information of a user from a JSON data file.
func (h *Handlers) GetProfileInfo(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{}

View File

@ -1,6 +1,6 @@
LOAD get_profile_info 0
MAP get_profile_info
LOAD reset_incorrect 6
LOAD reset_incorrect 0
CATCH incorrect_pin flag_incorrect_pin 1
CATCH pin_entry flag_account_authorized 0
MOUT back 0