test add page error fix
This commit is contained in:
parent
a945005e76
commit
4a862ec06a
@ -11,5 +11,6 @@ RUN pnpm install --frozen-lockfile
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
RUN pnpm postbuild
|
||||||
|
|
||||||
CMD ["pnpm", "start"]
|
CMD ["pnpm", "start"]
|
||||||
|
|||||||
@ -4,9 +4,7 @@ services:
|
|||||||
container_name: bettersplit
|
container_name: bettersplit
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3004:3000"
|
||||||
expose:
|
|
||||||
- "3000"
|
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.bettersplit.rule=Host(`bettersplit.shortman.me`)"
|
- "traefik.http.routers.bettersplit.rule=Host(`bettersplit.shortman.me`)"
|
||||||
@ -21,7 +19,7 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
shm_size: 128mb
|
shm_size: 128mb
|
||||||
env_file:
|
env_file:
|
||||||
- .env.production
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
|
"postbuild": "pnpm db:push",
|
||||||
"export": "next export",
|
"export": "next export",
|
||||||
"check": "biome check .",
|
"check": "biome check .",
|
||||||
"check:unsafe": "biome check --write --unsafe .",
|
"check:unsafe": "biome check --write --unsafe .",
|
||||||
|
|||||||
@ -8,21 +8,17 @@ import { useExpenseStore } from "@/lib/store/expense-store";
|
|||||||
import ExpenseSplit from "./expense-split";
|
import ExpenseSplit from "./expense-split";
|
||||||
import ExpenseParticipants from "./expense-participants";
|
import ExpenseParticipants from "./expense-participants";
|
||||||
import { Separator } from "@/components/ui/separator";
|
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 addParticipants = useExpenseStore((state) => state.addParticipants);
|
||||||
const setPayments = useExpenseStore((state) => state.setPayments);
|
const setPayments = useExpenseStore((state) => state.setPayments);
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
addParticipants([sessionUser]);
|
if (sessionUser) {
|
||||||
setPayments([{ amount: 0, userId: sessionUser.id }]);
|
addParticipants([sessionUser]);
|
||||||
|
setPayments([{ amount: 0, userId: sessionUser.id }]);
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
if (!sessionUser) return <>sessino user missing</>;
|
||||||
const groupBadges = useExpenseStore((state) => state.groupBadges);
|
|
||||||
const addGroupBadges = useExpenseStore((state) => state.addGroupBadges);
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header text="Add Expense">
|
<Header text="Add Expense">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user