mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
All: Fix sorting by title in a case insensitive way
This commit is contained in:
parent
56605beea2
commit
03942a0073
@ -6,5 +6,6 @@
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules",
|
||||
"**/dist",
|
||||
],
|
||||
}
|
@ -255,14 +255,6 @@ class BaseModel {
|
||||
if (!options) options = {};
|
||||
|
||||
if (options.order && options.order.length) {
|
||||
// const items = [];
|
||||
// for (let i = 0; i < options.order.length; i++) {
|
||||
// const o = options.order[i];
|
||||
// let item = `\`${o.by}\``;
|
||||
// if (options.caseInsensitive === true) item += ' COLLATE NOCASE';
|
||||
// if (o.dir) item += ` ${o.dir}`;
|
||||
// items.push(item);
|
||||
// }
|
||||
sql += ` ORDER BY ${paginationToSql(options)}`;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ export default function(pagination: Pagination): string {
|
||||
for (let i = 0; i < pagination.order.length; i++) {
|
||||
const o = pagination.order[i];
|
||||
let item = `\`${o.by}\``;
|
||||
if (o.caseInsensitive === true) item += ' COLLATE NOCASE';
|
||||
if (!!o.caseInsensitive || !!pagination.caseInsensitive) item += ' COLLATE NOCASE';
|
||||
item += ` ${o.dir}`;
|
||||
sql.push(item);
|
||||
}
|
||||
|
@ -13,4 +13,5 @@ export interface Pagination {
|
||||
limit: number;
|
||||
order: PaginationOrder[];
|
||||
page: number;
|
||||
caseInsensitive?: boolean;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user