Unify the way alerts and users are handled on the DB side
This commit is contained in:
@@ -60,3 +60,11 @@ class UsersController:
|
||||
await user.get(self.table)
|
||||
user.subscribed_alerts.append(alert)
|
||||
await user.put(self.table)
|
||||
|
||||
async def remove_alert(self, user: int | User, alert: str | Alert) -> None:
|
||||
user = self._user_to_obj(user)
|
||||
alert = self._alert_to_obj(alert)
|
||||
await user.get(self.table)
|
||||
user.subscribed_alerts.remove(alert)
|
||||
await user.put(self.table)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user