post services integrations
This commit is contained in:
@@ -32,13 +32,11 @@ impl ChannelRepository {
|
||||
|
||||
pub async fn update(&self, active: channel::ActiveModel) -> AnyResult<channel::Model> {
|
||||
let channel = active.update(&self.context.db).await?;
|
||||
self.context.events.emit("channel_updated", channel.clone());
|
||||
Ok(channel)
|
||||
}
|
||||
|
||||
pub async fn create(&self, active: channel::ActiveModel) -> AnyResult<channel::Model> {
|
||||
let channel = active.insert(&self.context.db).await?;
|
||||
self.context.events.emit("channel_created", channel.clone());
|
||||
Ok(channel)
|
||||
}
|
||||
|
||||
@@ -46,7 +44,6 @@ impl ChannelRepository {
|
||||
let res = channel::Entity::delete_by_id(id)
|
||||
.exec(&self.context.db)
|
||||
.await?;
|
||||
self.context.events.emit("channel_deleted", id);
|
||||
Ok(res.rows_affected > 0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user