Implement the seek-based tasks list pagination

This commit is contained in:
Kerollmops 2022-05-31 11:56:51 +02:00
parent d22f07f5b2
commit 9d5cc88cd5
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
2 changed files with 32 additions and 13 deletions

View file

@ -180,7 +180,7 @@ fn serialize_duration<S: Serializer>(
#[derive(Debug, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct TaskView {
uid: TaskId,
pub uid: TaskId,
index_uid: Option<String>,
status: TaskStatus,
#[serde(rename = "type")]
@ -369,13 +369,9 @@ impl From<Task> for TaskView {
#[derive(Debug, Serialize)]
pub struct TaskListView {
results: Vec<TaskView>,
}
impl From<Vec<TaskView>> for TaskListView {
fn from(results: Vec<TaskView>) -> Self {
Self { results }
}
pub results: Vec<TaskView>,
pub limit: usize,
pub after: Option<TaskId>,
}
#[derive(Debug, Serialize)]