This commit is contained in:
parent
693f252ae9
commit
76f976937a
|
@ -230,21 +230,8 @@ type AuthorProfile struct {
|
|||
// GetUserAppDataFromRedis retrieves user profile and follows from Redis, combines them into a JSON format,
|
||||
// and assigns the JSON string to the provided user's ID.
|
||||
func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) {
|
||||
// Получаем ID автора из Redis
|
||||
authorIdString, err := c.store.Get(c.ctx, fmt.Sprintf("author:user:%s", userId)).Result()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Преобразуем ID автора из строки в int
|
||||
var authorId int
|
||||
err = json.Unmarshal([]byte(authorIdString), &authorId)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
// Получаем профиль автора из Redis
|
||||
authorProfileString, err := c.store.Get(c.ctx, fmt.Sprintf("author:id:%d", authorId)).Result()
|
||||
authorProfileString, err := c.store.Get(c.ctx, fmt.Sprintf("author:user:%d", userId)).Result()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ func DeleteUserResolver(ctx context.Context, params model.DeleteUserInput) (*mod
|
|||
// delete otp for given email
|
||||
otp, err := db.Provider.GetOTPByEmail(ctx, refs.StringValue(user.Email))
|
||||
if err != nil {
|
||||
log.Infof("No OTP found for email (%s): %v", user.Email, err)
|
||||
log.Info("No OTP found for email (%s): %v", user.Email, err)
|
||||
// continue
|
||||
} else {
|
||||
err := db.Provider.DeleteOTP(ctx, otp)
|
||||
|
|
Loading…
Reference in New Issue
Block a user