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:
@@ -125,7 +125,7 @@ export class FieldValueService {
|
|||||||
let updateParticipants = false;
|
let updateParticipants = false;
|
||||||
let value: number | undefined = undefined;
|
let value: number | undefined = undefined;
|
||||||
for (const dto of dtos) {
|
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 });
|
await this.setValue({ accountId, entityId, fieldId: dto.fieldId, dto });
|
||||||
} else if (dto.state === ObjectState.Deleted) {
|
} else if (dto.state === ObjectState.Deleted) {
|
||||||
await this.delete({ accountId, entityId, fieldId: dto.fieldId });
|
await this.delete({ accountId, entityId, fieldId: dto.fieldId });
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ server {
|
|||||||
# Защита от атак на API
|
# Защита от атак на API
|
||||||
location /api/ {
|
location /api/ {
|
||||||
# Ограничение методов
|
# Ограничение методов
|
||||||
limit_except GET POST PUT DELETE OPTIONS {
|
limit_except GET POST PUT PATCH DELETE OPTIONS {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3838
crm.mcmed.ru.txt
Normal file
3838
crm.mcmed.ru.txt
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user