Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
joel-jeremy committed Mar 4, 2025
1 parent 9211aaa commit d6fa68d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/loot-core/src/server/budget/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ async function deleteCategory({
}): Promise<{ error?: 'no-categories' | 'category-type' }> {
let result = {};
await batchMessages(async () => {
const row = await db.first(
const row = await db.first<Pick<db.DbCategory, 'is_income'>>(
'SELECT is_income FROM categories WHERE id = ?',
[id],
);
Expand All @@ -322,9 +322,10 @@ async function deleteCategory({

const transfer =
transferId &&
(await db.first('SELECT is_income FROM categories WHERE id = ?', [
transferId,
]));
(await db.first<Pick<db.DbCategory, 'is_income'>>(
'SELECT is_income FROM categories WHERE id = ?',
[transferId],
));

if (!row || (transferId && !transfer)) {
result = { error: 'no-categories' };
Expand Down

0 comments on commit d6fa68d

Please sign in to comment.