feat: add markAllNotificationsRead method to UserService

This commit is contained in:
gabdevele
2026-06-15 10:30:45 +02:00 Unverified
parent a784094692
commit c5fede30ad
11 changed files with 65 additions and 1478 deletions
+10
View File
@@ -120,6 +120,16 @@ Json::Value UserService::markNotificationRead(const auth::UserContext &user,
return success();
}
Json::Value UserService::markAllNotificationsRead(const auth::UserContext &user)
{
drogon::app().getDbClient()->execSqlSync(
"UPDATE notifications "
"SET read_at = COALESCE(read_at, NOW()) "
"WHERE user_id = ?",
user.id);
return success();
}
Json::Value UserService::rewards(const auth::UserContext &user,
const std::optional<std::string> &page,
const std::optional<std::string> &perPage)
+1
View File
@@ -17,6 +17,7 @@ class UserService
const std::optional<std::string> &perPage);
Json::Value markNotificationRead(const auth::UserContext &user,
long long notificationId);
Json::Value markAllNotificationsRead(const auth::UserContext &user);
Json::Value rewards(const auth::UserContext &user,
const std::optional<std::string> &page,
const std::optional<std::string> &perPage);