feat: news router

This commit is contained in:
ericprd
2025-03-02 04:36:17 +08:00
parent f4ae93bc48
commit 915f12eaf7
49 changed files with 863 additions and 132 deletions
@@ -15,7 +15,7 @@ func (ur *UserRepository) GetUserByEmail(email string) (*authdomain.User, error)
return nil, errors.New("email is empty")
}
if err := ur.DB.First(&user, "email = ?", email).Error; err != nil {
if err := ur.DB.Find(&user, "email = ?", email).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("user not found")
}