This commit is contained in:
2026-05-16 17:57:54 +02:00
parent 1a2ec26f27
commit b2cefb7d66
55 changed files with 1654 additions and 334 deletions
+7 -4
View File
@@ -73,12 +73,15 @@ impl UserRepository {
Ok(())
}
pub async fn delete(&self, id: uuid::Uuid) -> AnyResult<()> {
user::Entity::delete_by_id(id)
pub async fn delete(&self, id: uuid::Uuid) -> AnyResult<bool> {
let result = user::Entity::delete_by_id(id)
.exec(&self.context.db)
.await?;
self.context.events.emit("user_deleted", id);
Ok(())
let deleted = result.rows_affected > 0;
if deleted {
self.context.events.emit("user_deleted", id);
}
Ok(deleted)
}
pub async fn username_exists(&self, username: &str) -> AnyResult<bool> {