test add page error fix

This commit is contained in:
mr-shortman 2025-05-03 19:32:58 +02:00
parent a945005e76
commit 4a862ec06a
4 changed files with 10 additions and 14 deletions

View File

@ -11,5 +11,6 @@ RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
RUN pnpm postbuild
CMD ["pnpm", "start"]

View File

@ -4,9 +4,7 @@ services:
container_name: bettersplit
restart: always
ports:
- "3000:3000"
expose:
- "3000"
- "3004:3000"
labels:
- "traefik.enable=true"
- "traefik.http.routers.bettersplit.rule=Host(`bettersplit.shortman.me`)"
@ -21,7 +19,7 @@ services:
restart: always
shm_size: 128mb
env_file:
- .env.production
- .env
volumes:
- pgdata:/var/lib/postgresql/data
ports:

View File

@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"build": "next build",
"postbuild": "pnpm db:push",
"export": "next export",
"check": "biome check .",
"check:unsafe": "biome check --write --unsafe .",

View File

@ -8,21 +8,17 @@ import { useExpenseStore } from "@/lib/store/expense-store";
import ExpenseSplit from "./expense-split";
import ExpenseParticipants from "./expense-participants";
import { Separator } from "@/components/ui/separator";
import { useSearchParams } from "next/navigation";
import { api } from "@/trpc/react";
function ExpensePage({ sessionUser }: { sessionUser: User }) {
function ExpensePage({ sessionUser }: { sessionUser?: User }) {
const addParticipants = useExpenseStore((state) => state.addParticipants);
const setPayments = useExpenseStore((state) => state.setPayments);
React.useEffect(() => {
if (sessionUser) {
addParticipants([sessionUser]);
setPayments([{ amount: 0, userId: sessionUser.id }]);
}
}, []);
const groupBadges = useExpenseStore((state) => state.groupBadges);
const addGroupBadges = useExpenseStore((state) => state.addGroupBadges);
if (!sessionUser) return <>sessino user missing</>;
return (
<>
<Header text="Add Expense">