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,
|
// 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.
|
// and assigns the JSON string to the provided user's ID.
|
||||||
func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) {
|
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
|
// Получаем профиль автора из 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 {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ func DeleteUserResolver(ctx context.Context, params model.DeleteUserInput) (*mod
|
||||||
// delete otp for given email
|
// delete otp for given email
|
||||||
otp, err := db.Provider.GetOTPByEmail(ctx, refs.StringValue(user.Email))
|
otp, err := db.Provider.GetOTPByEmail(ctx, refs.StringValue(user.Email))
|
||||||
if err != nil {
|
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
|
// continue
|
||||||
} else {
|
} else {
|
||||||
err := db.Provider.DeleteOTP(ctx, otp)
|
err := db.Provider.DeleteOTP(ctx, otp)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user