fix: settings screen

This commit is contained in:
Max Koon
2025-10-20 21:49:08 -04:00
parent acfe62eb37
commit 0f958feb8d
4 changed files with 24 additions and 7 deletions

View File

@@ -5,14 +5,19 @@ import { type AuthData } from "./auth";
import { isLoggedIn } from "./zql";
export const queries = {
me: syncedQueryWithContext('me', z.tuple([]), (authData: AuthData | null) => {
isLoggedIn(authData);
return builder.users
.where('id', '=', authData.user.id)
.one();
}),
allTransactions: syncedQueryWithContext('allTransactions', z.tuple([]), (authData: AuthData | null) => {
isLoggedIn(authData);
return builder.transaction
.where('user_id', '=', authData.user.id)
.orderBy('datetime', 'desc')
.limit(50)
}
),
}),
getPlaidLink: syncedQueryWithContext('getPlaidLink', z.tuple([]), (authData: AuthData | null) => {
isLoggedIn(authData);
return builder.plaidLink
@@ -23,6 +28,7 @@ export const queries = {
getBalances: syncedQueryWithContext('getBalances', z.tuple([]), (authData: AuthData | null) => {
isLoggedIn(authData);
return builder.balance
.where('user_id', '=', authData.user.id);
.where('user_id', '=', authData.user.id)
.orderBy('name', 'asc');
})
};