mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 08:44:27 +01:00
ignore primary key if it is already set
This commit is contained in:
parent
69c91d2b56
commit
a95a18afe4
@ -175,7 +175,6 @@ async fn update_multiple_documents(
|
|||||||
.ok_or(meilisearch_core::Error::SchemaMissing)?;
|
.ok_or(meilisearch_core::Error::SchemaMissing)?;
|
||||||
|
|
||||||
match (params.into_inner().primary_key, schema.primary_key()) {
|
match (params.into_inner().primary_key, schema.primary_key()) {
|
||||||
(Some(_), Some(_)) => return Err(meilisearch_schema::Error::PrimaryKeyAlreadyPresent)?,
|
|
||||||
(Some(key), None) => document_addition.set_primary_key(key),
|
(Some(key), None) => document_addition.set_primary_key(key),
|
||||||
(None, None) => {
|
(None, None) => {
|
||||||
let key = body
|
let key = body
|
||||||
@ -184,7 +183,7 @@ async fn update_multiple_documents(
|
|||||||
.ok_or(meilisearch_core::Error::MissingPrimaryKey)?;
|
.ok_or(meilisearch_core::Error::MissingPrimaryKey)?;
|
||||||
document_addition.set_primary_key(key);
|
document_addition.set_primary_key(key);
|
||||||
}
|
}
|
||||||
(None, Some(_)) => ()
|
_ => ()
|
||||||
}
|
}
|
||||||
|
|
||||||
for document in body.into_inner() {
|
for document in body.into_inner() {
|
||||||
|
Loading…
Reference in New Issue
Block a user