From 7b40012df4ccb2dffbd327e42958aefe303553ae Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Tue, 9 Sep 2025 15:42:39 +0800 Subject: [PATCH] fix: implement missing $getAllAccountDids method in PlatformServiceMixin - Add $getAllAccountDids() implementation to resolve TypeError in ProjectsView - Method queries accounts table and returns array of DIDs - Includes proper error handling and logging - Fixes "this.$getAllAccountDids is not a function" console error on /projects route The method was declared in TypeScript interfaces but never implemented, causing runtime errors when ProjectsView tried to initialize user identities. --- src/utils/PlatformServiceMixin.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/utils/PlatformServiceMixin.ts b/src/utils/PlatformServiceMixin.ts index 6c1b1f2a..e1f8b4fd 100644 --- a/src/utils/PlatformServiceMixin.ts +++ b/src/utils/PlatformServiceMixin.ts @@ -1498,6 +1498,31 @@ export const PlatformServiceMixin = { } }, + /** + * Get all account DIDs - $getAllAccountDids() + * Retrieves all account DIDs from the accounts table + * @returns Promise Array of account DIDs + */ + async $getAllAccountDids(): Promise { + try { + const result = await this.$dbQuery( + "SELECT did FROM accounts ORDER BY did", + ); + + if (!result?.values?.length) { + return []; + } + + return result.values.map((row: SqlValue[]) => row[0] as string); + } catch (error) { + logger.error( + "[PlatformServiceMixin] Error getting all account DIDs:", + error, + ); + return []; + } + }, + // ================================================= // TEMP TABLE METHODS (for temporary storage) // =================================================