Skip to content

Commit

Permalink
refactor!(serialize_library): update pagination logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tymmesyde committed Feb 27, 2024
1 parent 80898bc commit 15e9257
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/model/serialize_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ mod model {
pub struct Selectable<'a> {
pub types: Vec<SelectableType<'a>>,
pub sorts: Vec<SelectableSort<'a>>,
pub prev_page: Option<SelectablePage>,
pub next_page: Option<SelectablePage>,
pub next_page: bool,
}
#[derive(Serialize)]
pub struct LibraryWithFilters<'a> {
Expand Down Expand Up @@ -91,18 +90,7 @@ pub fn serialize_library<F>(
.into_web_deep_links(),
})
.collect(),
prev_page: library.selectable.prev_page.as_ref().map(|prev_page| {
model::SelectablePage {
deep_links: LibraryDeepLinks::from((&root, &prev_page.request))
.into_web_deep_links(),
}
}),
next_page: library.selectable.next_page.as_ref().map(|next_page| {
model::SelectablePage {
deep_links: LibraryDeepLinks::from((&root, &next_page.request))
.into_web_deep_links(),
}
}),
next_page: library.selectable.next_page.is_some(),
},
catalog: library
.catalog
Expand Down

0 comments on commit 15e9257

Please sign in to comment.