perf: Slim down logged in round 2 (#20535)

* perf: Slim down loggedInViewer some more

* Move locationOptions to apps router

* Moved calVideo related handlers to separate router

* Moved calendar related handlers to separate router

* Rename

* Moved deleteCredential to new router

* Moved updateProfile to me router

* fix unit test

* fix e2e test

* tweak

* missing

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: unknown <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-04-04 15:33:14 -04:00
1 parent 1953402f81
commit e86ad03cde
66 files changed
+240 -205

No files matched your search

@@ -4,14 +4,14 @@ import type { RouterInputs } from "@calcom/trpc/react";
import { trpc } from "@calcom/trpc/react";
interface ICreateEventsOnCalendarSelectProps {
calendar?: RouterInputs["viewer"]["setDestinationCalendar"] | null;
calendar?: RouterInputs["viewer"]["calendars"]["setDestinationCalendar"] | null;
}
const CreateEventsOnCalendarSelect = (props: ICreateEventsOnCalendarSelectProps) => {
const { calendar } = props;
const { t } = useLocale();
const mutation = trpc.viewer.setDestinationCalendar.useMutation();
const connectedCalendarsQuery = trpc.viewer.connectedCalendars.useQuery();
const mutation = trpc.viewer.calendars.setDestinationCalendar.useMutation();
const connectedCalendarsQuery = trpc.viewer.calendars.connectedCalendars.useQuery();
return (
<>
@@ -16,7 +16,7 @@ interface IConnectCalendarsProps {
const ConnectedCalendars = (props: IConnectCalendarsProps) => {
const { nextStep, isPageLoading } = props;
const queryConnectedCalendars = trpc.viewer.connectedCalendars.useQuery({
const queryConnectedCalendars = trpc.viewer.calendars.connectedCalendars.useQuery({
onboarding: true,
eventTypeId: null,
});
@@ -38,7 +38,7 @@ const UserProfile = () => {
const [firstRender, setFirstRender] = useState(true);
// Create a separate mutation for avatar updates
const avatarMutation = trpc.viewer.updateProfile.useMutation({
const avatarMutation = trpc.viewer.me.updateProfile.useMutation({
onSuccess: async (data) => {
showToast(t("your_user_profile_updated_successfully"), "success");
setImageSrc(data.avatarUrl ?? "");
@@ -49,7 +49,7 @@ const UserProfile = () => {
});
// Original mutation remains for onboarding completion
const mutation = trpc.viewer.updateProfile.useMutation({
const mutation = trpc.viewer.me.updateProfile.useMutation({
onSuccess: async () => {
try {
if (eventTypes?.length === 0) {
@@ -58,7 +58,7 @@ const UserSettings = (props: IUserSettingsProps) => {
await utils.viewer.me.invalidate();
nextStep();
};
const mutation = trpc.viewer.updateProfile.useMutation({
const mutation = trpc.viewer.me.updateProfile.useMutation({
onSuccess: onSuccess,
});