mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Do not expect a JSON value as a document indentifer
This commit is contained in:
parent
ee4e9dcc74
commit
04d1da11f7
@ -4,7 +4,6 @@ use crate::Data;
|
||||
use chrono::Utc;
|
||||
use heed::types::{SerdeBincode, Str};
|
||||
use meilisearch_core::Index;
|
||||
use serde_json::Value;
|
||||
use tide::Context;
|
||||
|
||||
pub trait ContextExt {
|
||||
@ -103,14 +102,8 @@ impl ContextExt for Context<Data> {
|
||||
|
||||
fn identifier(&self) -> Result<String, ResponseError> {
|
||||
let name = self
|
||||
.param::<Value>("identifier")
|
||||
.as_ref()
|
||||
.map(meilisearch_core::serde::value_to_string)
|
||||
.map_err(|e| ResponseError::bad_parameter("identifier", e))?
|
||||
.ok_or(ResponseError::bad_parameter(
|
||||
"identifier",
|
||||
"missing parameter",
|
||||
))?;
|
||||
.param::<String>("identifier")
|
||||
.map_err(|e| ResponseError::bad_parameter("identifier", e))?;
|
||||
|
||||
Ok(name)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user