forked from jsnbuchanan/crowd-funder-for-time-pwa
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.
This commit is contained in:
@@ -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)
|
||||
// =================================================
|
||||
|
||||
Reference in New Issue
Block a user