mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-18 17:11:15 +08:00
take existing_index out of create_index error
This commit is contained in:
parent
df7284a4df
commit
db45826232
@ -178,7 +178,10 @@ async fn create_index(
|
|||||||
let created_index = data
|
let created_index = data
|
||||||
.db
|
.db
|
||||||
.create_index(&uid)
|
.create_index(&uid)
|
||||||
.map_err(Error::create_index)?;
|
.map_err(|e| match e {
|
||||||
|
meilisearch_core::Error::IndexAlreadyExists => e.into(),
|
||||||
|
_ => ResponseError::from(Error::create_index(e))
|
||||||
|
})?;
|
||||||
|
|
||||||
let index_response = data.db.main_write::<_, _, ResponseError>(|mut writer| {
|
let index_response = data.db.main_write::<_, _, ResponseError>(|mut writer| {
|
||||||
let name = body.name.as_ref().unwrap_or(&uid);
|
let name = body.name.as_ref().unwrap_or(&uid);
|
||||||
|
Loading…
Reference in New Issue
Block a user