Add specific immutable_field error codes

This commit is contained in:
Loïc Lecrenier 2023-01-12 09:35:56 +01:00 committed by Tamo
parent 2bc60c29fc
commit 7f80b116bc
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
5 changed files with 51 additions and 18 deletions

View file

@ -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