mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Make PATCH only modify name, description, and updated_at fields
This commit is contained in:
parent
96a5791e39
commit
d54643455c
@ -97,20 +97,10 @@ impl Key {
|
|||||||
self.description = des?;
|
self.description = des?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(act) = value.get("actions") {
|
if let Some(des) = value.get("name") {
|
||||||
let act = from_value(act.clone())
|
let des = from_value(des.clone())
|
||||||
.map_err(|_| AuthControllerError::InvalidApiKeyActions(act.clone()));
|
.map_err(|_| AuthControllerError::InvalidApiKeyName(des.clone()));
|
||||||
self.actions = act?;
|
self.name = des?;
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(ind) = value.get("indexes") {
|
|
||||||
let ind = from_value(ind.clone())
|
|
||||||
.map_err(|_| AuthControllerError::InvalidApiKeyIndexes(ind.clone()));
|
|
||||||
self.indexes = ind?;
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(exp) = value.get("expiresAt") {
|
|
||||||
self.expires_at = parse_expiration_date(exp)?;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.updated_at = OffsetDateTime::now_utc();
|
self.updated_at = OffsetDateTime::now_utc();
|
||||||
|
Loading…
Reference in New Issue
Block a user