Fix model issues.
This commit is contained in:
@@ -27,7 +27,7 @@ func GetNotificationCount(db *sql.DB, userID int) int {
|
||||
var count int
|
||||
err := db.QueryRow(`
|
||||
SELECT COUNT(*) FROM users_notification
|
||||
WHERE userId = ? AND is_read = FALSE`, userID).Scan(&count)
|
||||
WHERE user_Id = ? AND is_read = FALSE`, userID).Scan(&count)
|
||||
|
||||
if err != nil {
|
||||
log.Println("⚠️ Failed to count notifications:", err)
|
||||
@@ -41,7 +41,7 @@ func GetRecentNotifications(db *sql.DB, userID int, limit int) []models.Notifica
|
||||
rows, err := db.Query(`
|
||||
SELECT id, subject, body, is_read, created_at
|
||||
FROM users_notification
|
||||
WHERE userId = ?
|
||||
WHERE user_Id = ?
|
||||
ORDER BY created_at DESC
|
||||
LIMIT ?`, userID, limit)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user