fix: pg db timezone, dialog mount child when visible, show non expired link and more

This commit is contained in:
Max Koon
2025-11-22 11:14:29 -05:00
parent 0edbf53db3
commit c4bb0d3304
15 changed files with 199 additions and 185 deletions

View File

@@ -1,6 +1,7 @@
import type { Transaction } from "@rocicorp/zero";
import type { AuthData } from "./auth";
import { isLoggedIn, type Schema } from ".";
import { type Schema } from "./zero-schema.gen";
import { isLoggedIn } from "./zql";
type Tx = Transaction<Schema>;

View File

@@ -1,6 +1,6 @@
import { syncedQueryWithContext } from "@rocicorp/zero";
import { z } from "zod";
import { builder } from ".";
import { builder } from "./zero-schema.gen";
import { type AuthData } from "./auth";
import { isLoggedIn } from "./zql";
@@ -22,7 +22,7 @@ export const queries = {
isLoggedIn(authData);
return builder.plaidLink
.where('user_id', '=', authData.user.id)
.where('createdAt', '<', new Date().getTime() + (1000 * 60 * 60 * 4))
.where('createdAt', '>', new Date().getTime() - (1000 * 60 * 60 * 4))
.orderBy('createdAt', 'desc')
.one();
}),

View File

@@ -3,7 +3,6 @@ import type { AuthData } from "./auth";
export function isLoggedIn(
authData: AuthData | null,
): asserts authData is AuthData {
console.log("AUTHDATA", authData);
if (!authData?.user.id) {
throw new Error("User is not logged in");
}