feat: add auth to context

This commit is contained in:
Max Koon
2025-11-15 22:08:58 -05:00
parent 641dc25bee
commit 114eaf88eb
11 changed files with 250 additions and 37 deletions

View File

@@ -12,9 +12,9 @@ export const queries = {
.one();
}),
allTransactions: syncedQueryWithContext('allTransactions', z.tuple([]), (authData: AuthData | null) => {
// isLoggedIn(authData);
isLoggedIn(authData);
return builder.transaction
// .where('user_id', '=', authData.user.id)
.where('user_id', '=', authData.user.id)
.orderBy('datetime', 'desc')
.limit(50)
}),
@@ -32,9 +32,9 @@ export const queries = {
.orderBy('name', 'asc');
}),
getItems: syncedQueryWithContext('getItems', z.tuple([]), (authData: AuthData | null) => {
// isLoggedIn(authData);
isLoggedIn(authData);
return builder.plaidAccessTokens
// .where('userId', '=', authData.user.id)
.where('userId', '=', authData.user.id)
.orderBy('createdAt', 'desc');
})
};