Skip to content

Commit

Permalink
Removed type casting
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Dec 20, 2024
1 parent cd2d560 commit bd89dc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export const getModels = async (
rawResults = (await db.query(transaction.statements)).map((r) => r.rows);
}

const results = transaction.formatResults(rawResults, false);
const models = (results[0] as unknown as { records: Array<Model> }).records;
const results = transaction.formatResults<Model>(rawResults, false);
const models = 'records' in results[0] ? results[0].records : [];

return models.map((model) => ({
...model,
Expand Down

0 comments on commit bd89dc3

Please sign in to comment.