pub async fn reorder_pages(
conn: &mut PgConnection,
pages: &[Page],
course_id: Uuid,
) -> ModelResult<()>
Expand description
Makes the order numbers and chapter ids to match in the db what’s in the page objects Assumes that all pages belong to the given course id Also assumes the list of pages includes all nondeleted pages in the course, except chapter front pages, which cannot be moved, otherwise we will end up with random order numbers