fix: linting issues
This commit is contained in:
@@ -123,6 +123,7 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
if (!operation) continue;
|
||||
|
||||
try {
|
||||
let queryResult: QueryExecResult[] = [];
|
||||
let result: unknown;
|
||||
switch (operation.type) {
|
||||
case "run":
|
||||
@@ -132,11 +133,11 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
result = await this.db.exec(operation.sql, operation.params);
|
||||
break;
|
||||
case "getOneRow":
|
||||
const queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
result = queryResult[0]?.values[0];
|
||||
break;
|
||||
case "getAll":
|
||||
const allResult = await this.db.exec(operation.sql, operation.params);
|
||||
queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
result = allResult[0]?.values || [];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,12 @@ export class WebPlatformService implements PlatformService {
|
||||
return databaseService.run(sql, params);
|
||||
}
|
||||
|
||||
async dbGetOneRow(sql: string, params?: unknown[]): Promise<unknown[] | undefined> {
|
||||
return databaseService.query(sql, params).then((result: QueryExecResult[]) => result[0]?.values[0]);
|
||||
async dbGetOneRow(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<unknown[] | undefined> {
|
||||
return databaseService
|
||||
.query(sql, params)
|
||||
.then((result: QueryExecResult[]) => result[0]?.values[0]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user