|
|
@@ -10,7 +10,8 @@ export class ChannelService {
|
|
|
constructor(
|
|
|
@InjectRepository(Channel)
|
|
|
private channelRepository: Repository<Channel>
|
|
|
- ) {}
|
|
|
+ ) {
|
|
|
+ }
|
|
|
|
|
|
async all() {
|
|
|
return await this.channelRepository.find()
|
|
|
@@ -27,4 +28,15 @@ export class ChannelService {
|
|
|
async delete(id: number): Promise<void> {
|
|
|
await this.channelRepository.delete(id)
|
|
|
}
|
|
|
+
|
|
|
+ async openAll(id: number, flag: number) {
|
|
|
+ const channel = await this.channelRepository.findOne({
|
|
|
+ where: { id }
|
|
|
+ })
|
|
|
+ channel.countryConfig.forEach(item => {
|
|
|
+ item.enabled = flag === 0
|
|
|
+ })
|
|
|
+ return await this.channelRepository.save(channel)
|
|
|
+ }
|
|
|
+
|
|
|
}
|