-
Notifications
You must be signed in to change notification settings - Fork 11.8k
refactor: Move Users Admin TRPC router from features package to trpc layer #25816
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
Conversation
| interface User { | ||
| id: number; |
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.
creating a type rather than coupling with UserAdminRouterOutputs which exists in trpc package now
| type FormValues = Pick< | ||
| User, | ||
| "avatarUrl" | "name" | "username" | "email" | "bio" | "createdDate" | "theme" | "defaultScheduleId" | "allowDynamicBooking" | ||
| | "avatarUrl" |
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.
just formatting changes
| </LicenseRequired> | ||
| ); | ||
| }; | ||
| interface User { |
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.
creating a type rather than coupling with UserAdminRouterOutputs which exists in trpc package now
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.
No issues found across 5 files
| const userIdSchema = z.object({ id: z.coerce.number() }); | ||
|
|
||
| const UsersEditPage = () => { |
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.
not used anywhere
| weekStart: string; | ||
| theme: string | null; | ||
| defaultScheduleId: number | null; | ||
| locale: string; |
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.
Build failed because locale is nullable in the database schema
| weekStart: string; | ||
| theme: string | null; | ||
| defaultScheduleId: number | null; | ||
| locale: string; |
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.
Build failed because locale is nullable in the database schema
|
Build failed because locale is nullable in the database schema |
What does this PR do?
Moves the
userAdminRouterfrompackages/features/ee/users/server/trpc-router.tstopackages/trpc/server/routers/viewer/users/_router.tsto follow the standard tRPC router organization pattern.Why?
This removes cross-package coupling by replacing imported types with local interfaces as well as circular dependencies where features layer import trpc layer
Changes
userAdminRoutertopackages/trpc/server/routers/viewer/users/_router.tsviewer/_router.tsxand/api/trpc/usershandlerUserAdminRouterOutputstype dependency with localUserinterface inUserForm.tsxandusers-edit-view.tsxUsersEditViewto accept aUserprop directly (removed page-level wrappers)Mandatory Tasks (DO NOT REMOVE)