-
Notifications
You must be signed in to change notification settings - Fork 1
Us6 profile #28
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
Merged
Merged
Us6 profile #28
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8461702
Creation of Router for profile
EfrainH2O 818e431
Route for delete user deleted
EfrainH2O 333dc93
The router now returns await
EfrainH2O bb2d731
Profile Card Created
EfrainH2O dbcea66
Update DB
richy-gs 058843e
Updated layout
richy-gs 7e3f9ef
Updated ProfileCard
richy-gs 209c28d
Added UserMenu component
richy-gs b4af488
Merge branch 'main' into US6_Profile
richy-gs ee54f94
Build Fixes
EfrainH2O 3bcbbe4
Updated layout
richy-gs 03f0545
Merge branch 'US6_Profile' of https://github.com/RoBorregos/swe-train…
richy-gs cd39812
await refetch();
richy-gs 7d57f77
last changes
richy-gs 7a1bdd7
Merge branch 'main' into US6_Profile
Ale-Coeto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { z } from "zod"; | ||
| import { createTRPCRouter, protectedProcedure } from "../trpc"; | ||
| // import { Prisma } from "@prisma/client"; | ||
|
|
||
| export const profileRouter = createTRPCRouter({ | ||
| getById: protectedProcedure.input(z.string()).query(async ({ ctx, input }) => { | ||
| return ctx.db.user.findUnique({ where: { id: input }, include: { accounts: true, sessions: false, solvedProblems: true } }); | ||
| }), | ||
| update: protectedProcedure | ||
| .input(z.object({ | ||
| id: z.string(), | ||
| name: z.string().optional(), | ||
| email: z.string().url().optional(), | ||
| image: z.string().optional(), | ||
| })) | ||
| .mutation(async ({ ctx, input }) => { | ||
| const { id, ...data } = input; | ||
| return ctx.db.user.update({ where: { id }, data }); | ||
|
||
| }), | ||
| }); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an await so that you don't return a promise