Skip to content

Commit

Permalink
fix: implement model name sort in model listing
Browse files Browse the repository at this point in the history
updates app listing to be sorted on model name

closes #156

Signed-off-by: Evan Mattiza <emattiza@gmail.com>
  • Loading branch information
emattiza committed Sep 11, 2023
1 parent 5c1739d commit fe6efc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,14 @@ impl ModelStorage {
}
});

futures::future::join_all(futs)
// Flatten, collect, and sort on name
let mut models = futures::future::join_all(futs)
.await
.into_iter()
.flatten()
.collect()
.collect::<Result<Vec<ModelSummary>>>()?;
models.sort_by_key(|model| model.name.to_owned());
Ok(models)
}

/// Deletes the given model from storage. This also removes the model from the list of all
Expand Down

0 comments on commit fe6efc8

Please sign in to comment.