Support Reminder events

Move code to schedule to have event independent from NotificationPlatform
This commit is contained in:
Mo Tarbin 2025-02-10 01:44:42 -05:00
parent 04d1894aea
commit 80afab3bc0
7 changed files with 61 additions and 28 deletions

View file

@ -75,9 +75,9 @@ func (r *UserRepository) UpdateUserCircle(c context.Context, userID, circleID in
return r.db.WithContext(c).Model(&uModel.User{}).Where("id = ?", userID).Update("circle_id", circleID).Error
}
func (r *UserRepository) FindByEmail(c context.Context, email string) (*uModel.User, error) {
var user *uModel.User
if err := r.db.WithContext(c).Where("email = ?", email).First(&user).Error; err != nil {
func (r *UserRepository) FindByEmail(c context.Context, email string) (*uModel.UserDetails, error) {
var user *uModel.UserDetails
if err := r.db.WithContext(c).Table("users u").Select("u.*, c.webhook_url as webhook_url").Joins("left join circles c on c.id = u.circle_id").Where("email = ?", email).First(&user).Error; err != nil {
return nil, err
}
return user, nil