Skip to content

Commit

Permalink
fixed join request functionality - was an issue in the backend projec…
Browse files Browse the repository at this point in the history
…t router function not calling create. Now it always calls create.
  • Loading branch information
AaronHonjaya committed Jan 24, 2024
1 parent a024e59 commit 7cbb617
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions client/src/pages/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ export default function Project() {
if(!projectId) return;
console.log("mutating");
mutation.mutate({
projectId: "c8ab9aff-5f09-45bb-bf22-7a6eea51eb65",
userId: user?.id
projectId: "66800fed-e1ab-4566-af05-e913616ee903",
userId: "aron1234"
})
}


const requestData = trpc.projects.getAllPendingRequests.useQuery("c8ab9aff-5f09-45bb-bf22-7a6eea51eb65");
const requestData = trpc.projects.getAllPendingRequests.useQuery("66800fed-e1ab-4566-af05-e913616ee903");

if(requestData.data != undefined) {
console.log(requestData.data);
Expand Down
19 changes: 12 additions & 7 deletions server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"devDependencies": {
"@types/cors": "^2.8.17",
"nodemon": "^3.0.2",
"prisma": "^5.7.0",
"ts-node": "^10.9.2"
}
}
7 changes: 2 additions & 5 deletions server/src/routers/projectsRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ export const projectsRouter = router({
where: input,
})

if (existing == null) {
ctx.db.memberships.create({ data: input })
} else {
// throw error code
}
await ctx.db.memberships.create({ data: input })

}),

getAllPendingRequests: publicProcedure
Expand Down

0 comments on commit 7cbb617

Please sign in to comment.