mirror of
https://github.com/immich-app/immich
synced 2026-08-22 13:13:05 +00:00
refactor(server): deprecate PUT routes in favor of PATCH (#28859)
* add patch routes and deprecate put * gen client
This commit is contained in:
parent
8860817c76
commit
9e453440e6
15 changed files with 1215 additions and 65 deletions
|
|
@ -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 { BulkIdsDto } from 'src/dtos/asset-ids.response.dto';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
|
|
@ -65,7 +65,11 @@ export class StackController {
|
|||
@Endpoint({
|
||||
summary: 'Update a stack',
|
||||
description: 'Update an existing stack by its ID.',
|
||||
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
|
||||
history: new HistoryBuilder()
|
||||
.added('v1')
|
||||
.beta('v1')
|
||||
.stable('v2')
|
||||
.deprecated('v3', { replacementId: 'updateStack' }),
|
||||
})
|
||||
updateStack(
|
||||
@Auth() auth: AuthDto,
|
||||
|
|
@ -75,6 +79,17 @@ export class StackController {
|
|||
return this.service.update(auth, id, dto);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
@ApiExcludeEndpoint()
|
||||
@Authenticated({ permission: Permission.StackUpdate })
|
||||
updateStackV3(
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
@Body() dto: StackUpdateDto,
|
||||
): Promise<StackResponseDto> {
|
||||
return this.service.update(auth, id, dto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@Authenticated({ permission: Permission.StackDelete })
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue