Unify the web UI on shared controls and let pipeline columns be managed on the board.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
Query,
|
||||
UseGuards,
|
||||
@@ -10,7 +13,12 @@ import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
||||
import { CurrentUser } from '../auth/current-user.decorator';
|
||||
import { Roles } from '../auth/roles.decorator';
|
||||
import { RolesGuard } from '../auth/roles.guard';
|
||||
import { CreatePipelineDto } from './dto';
|
||||
import {
|
||||
CreatePipelineDto,
|
||||
CreatePipelineStageDto,
|
||||
ReorderPipelineStagesDto,
|
||||
UpdatePipelineStageDto,
|
||||
} from './dto';
|
||||
import { PipelinesService } from './pipelines.service';
|
||||
|
||||
@Controller('pipelines')
|
||||
@@ -42,4 +50,62 @@ export class PipelinesController {
|
||||
) {
|
||||
return this.pipelinesService.create(user.organizationId, dto.name);
|
||||
}
|
||||
|
||||
@Post(':pipelineId/stages')
|
||||
@Roles('owner', 'admin')
|
||||
createStage(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Param('pipelineId') pipelineId: string,
|
||||
@Body() dto: CreatePipelineStageDto,
|
||||
) {
|
||||
return this.pipelinesService.createStage(
|
||||
user.organizationId,
|
||||
pipelineId,
|
||||
dto.name,
|
||||
);
|
||||
}
|
||||
|
||||
@Patch(':pipelineId/stages/order')
|
||||
@Roles('owner', 'admin')
|
||||
reorderStages(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Param('pipelineId') pipelineId: string,
|
||||
@Body() dto: ReorderPipelineStagesDto,
|
||||
) {
|
||||
return this.pipelinesService.reorderStages(
|
||||
user.organizationId,
|
||||
pipelineId,
|
||||
dto.stageIds,
|
||||
);
|
||||
}
|
||||
|
||||
@Patch(':pipelineId/stages/:stageId')
|
||||
@Roles('owner', 'admin')
|
||||
updateStage(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Param('pipelineId') pipelineId: string,
|
||||
@Param('stageId') stageId: string,
|
||||
@Body() dto: UpdatePipelineStageDto,
|
||||
) {
|
||||
return this.pipelinesService.updateStage(
|
||||
user.organizationId,
|
||||
pipelineId,
|
||||
stageId,
|
||||
dto.name,
|
||||
);
|
||||
}
|
||||
|
||||
@Delete(':pipelineId/stages/:stageId')
|
||||
@Roles('owner', 'admin')
|
||||
deleteStage(
|
||||
@CurrentUser() user: { organizationId: string },
|
||||
@Param('pipelineId') pipelineId: string,
|
||||
@Param('stageId') stageId: string,
|
||||
) {
|
||||
return this.pipelinesService.deleteStage(
|
||||
user.organizationId,
|
||||
pipelineId,
|
||||
stageId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user