feat: add markAllNotificationsRead method to UserService
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user