feat: sort projects by title internationally

This commit is contained in:
Matouš Volf
2024-09-19 21:25:41 +02:00
parent 0a092f5763
commit 5cb0241e07
2 changed files with 45 additions and 26 deletions

View File

@ -2,6 +2,7 @@ use std::cmp::Ordering;
use chrono::NaiveDateTime;
use crate::schema::projects;
use diesel::prelude::*;
use feruca::Collator;
use serde::{Deserialize, Serialize};
use validator::Validate;
@ -46,7 +47,7 @@ impl PartialOrd<Self> for Project {
impl Ord for Project {
fn cmp(&self, other: &Self) -> Ordering {
self.title().cmp(other.title())
Collator::default().collate(self.title(), other.title())
}
}