feat: add PATCH method to allowed API methods

Added PATCH to the list of allowed HTTP methods in the API location block to support partial updates to resources. This aligns with RESTful API conventions and enables clients to modify specific fields without sending a full resource representation.
This commit is contained in:
Viktoria Polyakova
2026-01-25 18:09:20 +00:00
parent 811176d388
commit f93a00bee7
3 changed files with 3840 additions and 2 deletions

View File

@@ -125,7 +125,7 @@ export class FieldValueService {
let updateParticipants = false;
let value: number | undefined = undefined;
for (const dto of dtos) {
if ([ObjectState.Created, ObjectState.Updated].includes(dto.state)) {
if ([ObjectState.Created, ObjectState.Updated].includes(dto.state as ObjectState)) {
await this.setValue({ accountId, entityId, fieldId: dto.fieldId, dto });
} else if (dto.state === ObjectState.Deleted) {
await this.delete({ accountId, entityId, fieldId: dto.fieldId });

View File

@@ -58,7 +58,7 @@ server {
# Защита от атак на API
location /api/ {
# Ограничение методов
limit_except GET POST PUT DELETE OPTIONS {
limit_except GET POST PUT PATCH DELETE OPTIONS {
deny all;
}

3838
crm.mcmed.ru.txt Normal file

File diff suppressed because one or more lines are too long