You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Desktop: Add support for OCR (#8975)
This commit is contained in:
@@ -346,16 +346,21 @@ class BaseModel {
|
||||
});
|
||||
}
|
||||
|
||||
public static modelSelectAll(sql: string, params: any[] = null) {
|
||||
public static modelSelectAll<T = any>(sql: string, params: any[] = null): Promise<T[]> {
|
||||
if (params === null) params = [];
|
||||
return this.db()
|
||||
.selectAll(sql, params)
|
||||
// eslint-disable-next-line promise/prefer-await-to-then -- Old code before rule was applied
|
||||
.then((models: any[]) => {
|
||||
return this.filterArray(this.addModelMd(models));
|
||||
return this.filterArray(this.addModelMd(models)) as T[];
|
||||
});
|
||||
}
|
||||
|
||||
protected static selectFields(options: LoadOptions): string {
|
||||
if (!options || !options.fields) return '*';
|
||||
return this.db().escapeFieldsToString(options.fields);
|
||||
}
|
||||
|
||||
public static loadByField(fieldName: string, fieldValue: any, options: LoadOptions = null) {
|
||||
if (!options) options = {};
|
||||
if (!('caseInsensitive' in options)) options.caseInsensitive = false;
|
||||
|
||||
Reference in New Issue
Block a user