From 2bb036616f9ec5ed827630f814d83c1c92d7fc2c Mon Sep 17 00:00:00 2001 From: KernelDeimos <7225168+KernelDeimos@users.noreply.github.com> Date: Wed, 24 Dec 2025 12:48:20 -0500 Subject: [PATCH] dev(data-access)`: app select `icon_size` param Adds the `icon_size` parameter to the `.select()` method on the new non-ES/OM implementation. When adding the necessary `params` parameter to the `.select()` method, it was noticed that the `predicate` parameter did not have a default value - potentially causing a regression; a default value was set for both `params` and `predicate`. --- .../src/modules/data-access/AppService.js | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/backend/src/modules/data-access/AppService.js b/src/backend/src/modules/data-access/AppService.js index 0998e5b7c..28540864a 100644 --- a/src/backend/src/modules/data-access/AppService.js +++ b/src/backend/src/modules/data-access/AppService.js @@ -38,9 +38,11 @@ export default class AppService extends BaseService { }, }; - async #select ({ predicate, ...rest }) { + async #select ({ predicate, params, ...rest }) { const db = this.db; + if ( predicate === undefined ) predicate = []; + if ( params === undefined ) params = {}; if ( ! Array.isArray(predicate) ) throw new Error('predicate must be an array'); const userCanEditOnly = Array.prototype.includes.call(predicate, 'user-can-edit'); @@ -122,6 +124,22 @@ export default class AppService extends BaseService { // REFINED BY OTHER DATA // app.icon; + if ( params.icon_size ) { + const icon_size = params.icon_size; + const svc_appIcon = this.context.get('services').get('app-icon'); + try { + const icon_result = await svc_appIcon.get_icon_stream({ + app_uid: row.uid, + app_icon: row.icon, + size: icon_size, + }); + console.log('this is working it looks like'); + app.icon = await icon_result.get_data_url(); + } catch (e) { + const svc_error = this.context.get('services').get('error-service'); + svc_error.report('AppES:read_transform', { source: e }); + } + } client_safe_apps.push(app); }