skailan-conversations
Version:
Servicio de conversaciones y mensajería para Skailan
15 lines • 506 B
JavaScript
export class DeleteChannel {
channelRepository;
constructor(channelRepository) {
this.channelRepository = channelRepository;
}
async execute(request) {
const { id, organizationId } = request;
const existingChannel = await this.channelRepository.findById(id);
if (!existingChannel) {
throw new Error('Channel not found.');
}
await this.channelRepository.delete(id, organizationId);
}
}
//# sourceMappingURL=DeleteChannel.js.map