From 42501c6a6cdc117c7d441bcae3c84bcbd88392f0 Mon Sep 17 00:00:00 2001 From: Henry Heino Date: Thu, 30 Jan 2025 11:58:37 -0800 Subject: [PATCH] Chore: Slightly stronger types in ResourceService.ts This is a refactoring change (change made while looking into https://github.com/laurent22/joplin/issues/11745). --- packages/lib/services/ResourceService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/lib/services/ResourceService.ts b/packages/lib/services/ResourceService.ts index 1c51fcb5a3..cfe04dba3f 100644 --- a/packages/lib/services/ResourceService.ts +++ b/packages/lib/services/ResourceService.ts @@ -10,6 +10,7 @@ import SearchEngine from './search/SearchEngine'; import ItemChangeUtils from './ItemChangeUtils'; import time from '../time'; import eventManager, { EventName } from '../eventManager'; +import { ItemChangeEntity } from './database/types'; const { sprintf } = require('sprintf-js'); export default class ResourceService extends BaseService { @@ -40,7 +41,7 @@ export default class ResourceService extends BaseService { let foundNoteWithEncryption = false; while (true) { - const changes = await ItemChange.modelSelectAll(` + const changes: ItemChangeEntity[] = await ItemChange.modelSelectAll(` SELECT id, item_id, type FROM item_changes WHERE item_type = ? @@ -52,8 +53,7 @@ export default class ResourceService extends BaseService { if (!changes.length) break; - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied - const noteIds = changes.map((a: any) => a.item_id); + const noteIds = changes.map(a => a.item_id); const notes = await Note.modelSelectAll(`SELECT id, title, body, encryption_applied FROM notes WHERE id IN (${Note.escapeIdsForSql(noteIds)})`); const noteById = (noteId: string) => {