Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix drink counting #47

Merged
merged 8 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"test:cov": "jest --coverage"
},
"dependencies": {
"@hookform/resolvers": "^3.9.0",
"@kir-dev/passport-authsch": "^2.0.3",
"@nestjs/cli": "^10.3.2",
"@nestjs/common": "^10.3.8",
Expand All @@ -30,12 +31,17 @@
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.3.8",
"@prisma/client": "^5.13.0",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-label": "^2.1.0",
"js-cookie": "^3.0.5",
"nestjs-prisma": "^0.23.0",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"react-hook-form": "^7.53.0",
"reflect-metadata": "^0.2.2",
"rimraf": "^5.0.5",
"rxjs": "^7.8.1"
"rxjs": "^7.8.1",
"zod": "^3.23.8"
Tschonti marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@nestjs/cli": "^10.3.2",
Expand Down
21 changes: 13 additions & 8 deletions apps/backend/src/events/events.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,23 @@
async create(data: CreateEventDto, userId: string): Promise<Event> {
const { drinkActions, ...eventData } = data;
try {
console.log('eventData:', eventData);

Check failure on line 18 in apps/backend/src/events/events.service.ts

View workflow job for this annotation

GitHub Actions / ESLint Check

Unexpected console statement
console.log('drinkActions:', drinkActions);

Check failure on line 19 in apps/backend/src/events/events.service.ts

View workflow job for this annotation

GitHub Actions / ESLint Check

Unexpected console statement
console.log('userId:', userId);

Check failure on line 20 in apps/backend/src/events/events.service.ts

View workflow job for this annotation

GitHub Actions / ESLint Check

Unexpected console statement
return await this.prisma.event.create({
data: {
...eventData,
ownerId: userId,
drinkActions: {
create:
drinkActions?.map(({ drinkId, ...action }) => ({
...action,
drink: { connect: { id: drinkId } },
user: { connect: { authSchId: userId } },
})) || [],
},
drinkActions:
drinkActions.length > 0
? {
create: drinkActions.map(({ drinkId, ...action }) => ({
...action,
drink: { connect: { id: drinkId } },
user: { connect: { authSchId: userId } },
})),
}
: undefined,
Tschonti marked this conversation as resolved.
Show resolved Hide resolved
},
include: { drinkActions: true },
});
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"js-cookie": "^3.0.5",
"date-fns": "^3.6.0",
"lucide-react": "^0.426.0",
"next": "14.2.2",
"react": "^18.2.0",
Expand Down
Loading
Loading