Browse Source

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.
pull/188/head
Jose Olarte III 1 week ago
parent
commit
7b40012df4
  1. 25
      src/utils/PlatformServiceMixin.ts

25
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<string[]> Array of account DIDs
*/
async $getAllAccountDids(): Promise<string[]> {
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) // TEMP TABLE METHODS (for temporary storage)
// ================================================= // =================================================

Loading…
Cancel
Save