fix: resolve 6 TypeScript compilation errors

Fixed field name mismatches and generic type issues:
- database.ts: Changed camelCase to snake_case for key_password, private_key, public_key fields
- simple-db-ops.ts: Added explicit generic type parameters to DataCrypto method calls

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-10-09 18:37:56 +08:00
parent aa6473fb48
commit 3b40eff2a9
2 changed files with 9 additions and 9 deletions

View File

@@ -57,14 +57,14 @@ class SimpleDBOps {
const results = await query;
const decryptedResults = DataCrypto.decryptRecords(
const decryptedResults = DataCrypto.decryptRecords<T>(
tableName,
results as unknown[],
results as T[],
userId,
userDataKey,
);
return decryptedResults as T[];
return decryptedResults;
}
static async selectOne<T extends Record<string, unknown>>(
@@ -80,9 +80,9 @@ class SimpleDBOps {
const result = await query;
if (!result) return undefined;
const decryptedResult = DataCrypto.decryptRecord(
const decryptedResult = DataCrypto.decryptRecord<T>(
tableName,
result as Record<string, unknown>,
result as T,
userId,
userDataKey,
);