refactor: better shortcut hook

This commit is contained in:
Max Koon
2025-12-05 17:05:23 -05:00
parent 2df7f2d924
commit 76f2a43bd0
21 changed files with 481 additions and 143 deletions

View File

@@ -60,4 +60,20 @@ export const queries = {
.orderBy("createdAt", "desc");
},
),
getBudgets: syncedQueryWithContext(
"getBudgets",
z.tuple([]),
(authData: AuthData | null) => {
isLoggedIn(authData);
return builder.budget.limit(10);
},
),
getBudgetCategories: syncedQueryWithContext(
"getBudgetCategories",
z.tuple([]),
(authData: AuthData | null) => {
isLoggedIn(authData);
return builder.category.orderBy("order", "desc");
},
),
};