feat: harden platform workflows and UI governance
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { RequireRecentAuthentication } from '../auth/require-recent-authentication.decorator';
|
||||
import { CurrentSessionUserId } from '../auth/current-session-user.decorator';
|
||||
import { DeleteTargetDto, DeletionGovernanceService } from '../deletion-governance/deletion-governance.service';
|
||||
import {
|
||||
ChannelsService,
|
||||
ChangeChannelStatusDto,
|
||||
@@ -25,7 +27,7 @@ import {
|
||||
@ApiTags('channels')
|
||||
@Controller('admin')
|
||||
export class ChannelsController {
|
||||
constructor(private readonly channels: ChannelsService) {}
|
||||
constructor(private readonly channels: ChannelsService, private readonly deletions: DeletionGovernanceService) {}
|
||||
|
||||
@Get('channels')
|
||||
listChannels() {
|
||||
@@ -64,8 +66,8 @@ export class ChannelsController {
|
||||
|
||||
@Delete('channels/:id')
|
||||
@RequireRecentAuthentication()
|
||||
deleteChannel(@Param('id') channelId: string, @Body() body: ChangeChannelStatusDto) {
|
||||
return this.channels.deleteChannel(channelId, body);
|
||||
deleteChannel(@Param('id') channelId: string, @Body() body: DeleteTargetDto, @CurrentSessionUserId() operatorId?: string) {
|
||||
return this.deletions.delete('channel', channelId, { ...body, operatorId });
|
||||
}
|
||||
|
||||
@Get('channels/:id/metrics')
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { ChannelsController } from './channels.controller';
|
||||
import { ChannelsService } from './channels.service';
|
||||
import { DeletionGovernanceModule } from '../deletion-governance/deletion-governance.module';
|
||||
|
||||
@Module({
|
||||
imports: [DeletionGovernanceModule],
|
||||
controllers: [ChannelsController],
|
||||
providers: [ChannelsService],
|
||||
exports: [ChannelsService],
|
||||
|
||||
Reference in New Issue
Block a user