mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
make Task index_uid an option
Not all task relate to an index. Tasks that don't have an index_uid set to None
This commit is contained in:
parent
9935db86c7
commit
aa50acb031
8 changed files with 79 additions and 35 deletions
|
@ -137,7 +137,7 @@ fn serialize_duration<S: Serializer>(
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct TaskView {
|
||||
uid: TaskId,
|
||||
index_uid: String,
|
||||
index_uid: Option<String>,
|
||||
status: TaskStatus,
|
||||
#[serde(rename = "type")]
|
||||
task_type: TaskType,
|
||||
|
@ -313,7 +313,7 @@ impl From<Task> for TaskView {
|
|||
|
||||
Self {
|
||||
uid: id,
|
||||
index_uid: index_uid.into_inner(),
|
||||
index_uid: index_uid.map(|u| u.into_inner()),
|
||||
status,
|
||||
task_type,
|
||||
details,
|
||||
|
@ -342,7 +342,7 @@ impl From<Vec<TaskView>> for TaskListView {
|
|||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SummarizedTaskView {
|
||||
uid: TaskId,
|
||||
index_uid: String,
|
||||
index_uid: Option<String>,
|
||||
status: TaskStatus,
|
||||
#[serde(rename = "type")]
|
||||
task_type: TaskType,
|
||||
|
@ -365,7 +365,7 @@ impl From<Task> for SummarizedTaskView {
|
|||
|
||||
Self {
|
||||
uid: other.id,
|
||||
index_uid: other.index_uid.to_string(),
|
||||
index_uid: other.index_uid.map(|u| u.into_inner()),
|
||||
status: TaskStatus::Enqueued,
|
||||
task_type: other.content.into(),
|
||||
enqueued_at,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue