1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop,Mobile,Cli: Fixes #11630: Adjust how items are queried by ID (#11734)

This commit is contained in:
Henry Heino
2025-01-27 10:34:46 -08:00
committed by GitHub
parent aa6348a127
commit cc1582d535
15 changed files with 59 additions and 32 deletions

View File

@@ -214,7 +214,7 @@ export default class Revision extends BaseItem {
public static async itemsWithRevisions(itemType: ModelType, itemIds: string[]) {
if (!itemIds.length) return [];
const rows = await this.db().selectAll(`SELECT distinct item_id FROM revisions WHERE item_type = ? AND item_id IN ('${itemIds.join('\',\'')}')`, [itemType]);
const rows = await this.db().selectAll(`SELECT distinct item_id FROM revisions WHERE item_type = ? AND item_id IN (${this.escapeIdsForSql(itemIds)})`, [itemType]);
return rows.map((r: RevisionEntity) => r.item_id);
}