refactor(server): deprecate PUT routes in favor of PATCH (#28859)

* add patch routes and deprecate put

* gen client
This commit is contained in:
Timon 2026-06-07 15:40:01 +02:00 committed by GitHub
parent 8860817c76
commit 9e453440e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1215 additions and 65 deletions

View file

@ -1,5 +1,5 @@
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Post, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { Body, Controller, Delete, Get, HttpCode, HttpStatus, Param, Patch, Post, Put, Query } from '@nestjs/common';
import { ApiExcludeEndpoint, ApiTags } from '@nestjs/swagger';
import { Endpoint, HistoryBuilder } from 'src/decorators';
import { AuthDto } from 'src/dtos/auth.dto';
import {
@ -81,7 +81,7 @@ export class WorkflowController {
summary: 'Update a workflow',
description:
'Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.',
history: HistoryBuilder.v3(),
history: new HistoryBuilder().added('v3.0.0').deprecated('v3', { replacementId: 'updateWorkflow' }),
})
updateWorkflow(
@Auth() auth: AuthDto,
@ -91,6 +91,17 @@ export class WorkflowController {
return this.service.update(auth, id, dto);
}
@Patch(':id')
@ApiExcludeEndpoint()
@Authenticated({ permission: Permission.WorkflowUpdate })
updateWorkflowV3(
@Auth() auth: AuthDto,
@Param() { id }: UUIDParamDto,
@Body() dto: WorkflowUpdateDto,
): Promise<WorkflowResponseDto> {
return this.service.update(auth, id, dto);
}
@Delete(':id')
@Authenticated({ permission: Permission.WorkflowDelete })
@HttpCode(HttpStatus.NO_CONTENT)