mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Add specific immutable_field error codes
This commit is contained in:
parent
2bc60c29fc
commit
7f80b116bc
5 changed files with 51 additions and 18 deletions
|
@ -181,7 +181,19 @@ DumpAlreadyProcessing , invalid , CONFLICT;
|
|||
DumpNotFound , invalid , NOT_FOUND;
|
||||
DumpProcessFailed , internal , INTERNAL_SERVER_ERROR;
|
||||
DuplicateIndexFound , invalid , BAD_REQUEST;
|
||||
ImmutableField , invalid , BAD_REQUEST;
|
||||
|
||||
ImmutableApiKeyUid , invalid , BAD_REQUEST;
|
||||
ImmutableApiKeyKey , invalid , BAD_REQUEST;
|
||||
ImmutableApiKeyActions , invalid , BAD_REQUEST;
|
||||
ImmutableApiKeyIndexes , invalid , BAD_REQUEST;
|
||||
ImmutableApiKeyExpiresAt , invalid , BAD_REQUEST;
|
||||
ImmutableApiKeyCreatedAt , invalid , BAD_REQUEST;
|
||||
ImmutableApiKeyUpdatedAt , invalid , BAD_REQUEST;
|
||||
|
||||
ImmutableIndexUid , invalid , BAD_REQUEST;
|
||||
ImmutableIndexCreatedAt , invalid , BAD_REQUEST;
|
||||
ImmutableIndexUpdatedAt , invalid , BAD_REQUEST;
|
||||
|
||||
IndexAlreadyExists , invalid , CONFLICT ;
|
||||
IndexCreationFailed , internal , INTERNAL_SERVER_ERROR;
|
||||
IndexNotFound , invalid , NOT_FOUND;
|
||||
|
|
|
@ -80,12 +80,12 @@ fn deny_immutable_fields_api_key(
|
|||
));
|
||||
|
||||
error.code = match field {
|
||||
"uid" => Code::ImmutableField,
|
||||
"actions" => Code::ImmutableField,
|
||||
"indexes" => Code::ImmutableField,
|
||||
"expiresAt" => Code::ImmutableField,
|
||||
"createdAt" => Code::ImmutableField,
|
||||
"updatedAt" => Code::ImmutableField,
|
||||
"uid" => Code::ImmutableApiKeyUid,
|
||||
"actions" => Code::ImmutableApiKeyActions,
|
||||
"indexes" => Code::ImmutableApiKeyIndexes,
|
||||
"expiresAt" => Code::ImmutableApiKeyExpiresAt,
|
||||
"createdAt" => Code::ImmutableApiKeyCreatedAt,
|
||||
"updatedAt" => Code::ImmutableApiKeyUpdatedAt,
|
||||
_ => Code::BadRequest,
|
||||
};
|
||||
error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue