From c6f7dd00b2b7198f1947c803b65e640255777b41 Mon Sep 17 00:00:00 2001 From: Alfonso Salces Date: Fri, 11 Oct 2024 08:11:51 +0200 Subject: [PATCH] MOBILE-4616 blog: Fix getOfflineEntries filters --- src/addons/blog/services/blog-offline.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/addons/blog/services/blog-offline.ts b/src/addons/blog/services/blog-offline.ts index 3f584e7d4..3dbcd168a 100644 --- a/src/addons/blog/services/blog-offline.ts +++ b/src/addons/blog/services/blog-offline.ts @@ -19,6 +19,7 @@ import { CoreFileEntry } from '@services/file-helper'; import { CoreSites } from '@services/sites'; import { CoreUtils } from '@services/utils/utils'; import { makeSingleton } from '@singletons'; +import { CoreObject } from '@singletons/object'; import { CorePath } from '@singletons/path'; import { AddonBlogFilter } from './blog'; import { @@ -126,9 +127,13 @@ export class AddonBlogOfflineService { * * @returns Offline entries. */ - async getOfflineEntries(filters?: AddonBlogFilter, siteId?: string): Promise { + async getOfflineEntries(filters: AddonBlogFilter = {}, siteId?: string): Promise { + const { entryid: id, userid } = filters; const site = await CoreSites.getSite(siteId); - const records = await site.getDb().getRecords(OFFLINE_BLOG_ENTRIES_TABLE_NAME, filters); + const records = await site.getDb().getRecords( + OFFLINE_BLOG_ENTRIES_TABLE_NAME, + CoreObject.withoutUndefined({ id, userid }), + ); return records.map(record => { if ('id' in record && record.id && record.id < 0) {